[Intel-gfx] [PATCH 06/11] dma-buf: Introduce fence_get_rcu_safe()
Markus Heiser
markus.heiser at darmarit.de
Fri Sep 23 13:34:32 UTC 2016
Am 23.09.2016 um 14:59 schrieb Daniel Vetter <daniel at ffwll.ch>:
>>
>> /**
>> - * fence_put - decreases refcount of the fence
>> - * @fence: [in] fence to reduce refcount of
>> + * fence_get_rcu_safe - acquire a reference to an RCU tracked fence
>> + * @fence: [in] pointer to fence to increase refcount of
>> + *
>> + * Function returns NULL if no refcount could be obtained, or the fence.
>> + * This function handles acquiring a reference to a fence that may be
>> + * reallocated within the RCU grace period (such as with SLAB_DESTROY_BY_RCU),
>> + * so long as the caller is using RCU on the pointer to the fence.
>> + *
>> + * An alternative mechanism is to employ a seqlock to protect a bunch of
>> + * fences, such as used by struct reservation_object. When using a seqlock,
>> + * the seqlock must be taken before and checked after a reference to the
>> + * fence is acquired (as shown here).
>> + *
>> + * The caller is required to hold the RCU read lock.
>
> Would be good to cross reference the various fence_get functions a bit
> better in the docs. But since the docs aren't yet pulled into the rst/html
> output, that doesn't matter that much
Hi Daniel ... I'am working on ;-)
* http://return42.github.io/sphkerneldoc/linux_src_doc/include/linux/fence_h.html
-- Markus --
More information about the Intel-gfx
mailing list