Am 07.08.19 um 14:19 schrieb Chris Wilson: > Quoting Christian König (2019-08-07 13:08:38) >> Am 06.08.19 um 21:57 schrieb Chris Wilson: >>> If we add to shared-list during the read, ... Hmm, actually we should >>> return num_list, i.e. >>> >>> do { >>> *list = rcu_dereference(obj->fence); >>> num_list = *list ? (*list)->count : 0; >>> smp_rmb(); >>> } while (...) >>> >>> return num_list. >>> >>> as the relationship between the count and the fence entries is also >>> determined by the mb in add_shared_fence. >> I've read that multiple times now, but can't follow. Why should we do this? >> >> The only important thing is that the readers see the new fence before >> the increment of the number of fences. > Exactly. We order the store so that the fence is in the list before we > update the count (so that we don't read garbage because the fence isn't > there yet). > > But we don't have the equivalent here for the read once the rmb is > removed from the seqcount_read_begin/end looping. We need to see the > update in the same order as was stored, and only use the coherent > portion of the list. Ok that makes sense. Going to fix up the code regarding to that. Christian. > -Chris _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/intel-gfx