[PATCH 07/10] dma-buf/resv: add new fences container implementation

Christian König ckoenig.leichtzumerken at gmail.com
Thu Aug 22 08:23:29 UTC 2019


Am 21.08.19 um 18:04 schrieb Daniel Vetter:
> On Wed, Aug 21, 2019 at 02:31:44PM +0200, Christian König wrote:
>> [SNIP]
>> +	/* Try to drop the last reference */
>> +	if (!dma_fence_array_recycle(staged))
> Without an rcu barrier here you're not syncing to new clients at all.
> I don't think this works, and I expect that once you've readded all the
> barriers and retry loops we're back to seqlocks.

The key difference is that RCU users now use dma_fence_get_rcu_safe() to 
grab a reference to the current set of fences.

In other words the whole array is reference counted and RCU protected 
instead of each individual entry in the array.

This way you don't need the sequence count any more because you grab a 
reference to all of them at once and then can be sure that they don't 
change.

Regards,
Christian.

> -Daniel



More information about the dri-devel mailing list