mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
dma-buf: Relax the write-seqlock for reallocating the shared fence list
As the set of shared fences is not being changed during reallocation of the reservation list, we can skip updating the write_seqlock. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Christian König <christian.koenig@amd.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20190712080314.21018-2-chris@chris-wilson.co.uk
This commit is contained in:
parent
45b2fda3d8
commit
30fe7b07f6
1 changed files with 7 additions and 7 deletions
|
@ -157,15 +157,15 @@ int reservation_object_reserve_shared(struct reservation_object *obj,
|
||||||
(ksize(new) - offsetof(typeof(*new), shared)) /
|
(ksize(new) - offsetof(typeof(*new), shared)) /
|
||||||
sizeof(*new->shared);
|
sizeof(*new->shared);
|
||||||
|
|
||||||
preempt_disable();
|
|
||||||
write_seqcount_begin(&obj->seq);
|
|
||||||
/*
|
/*
|
||||||
* RCU_INIT_POINTER can be used here,
|
* We are not changing the effective set of fences here so can
|
||||||
* seqcount provides the necessary barriers
|
* merely update the pointer to the new array; both existing
|
||||||
|
* readers and new readers will see exactly the same set of
|
||||||
|
* active (unsignaled) shared fences. Individual fences and the
|
||||||
|
* old array are protected by RCU and so will not vanish under
|
||||||
|
* the gaze of the rcu_read_lock() readers.
|
||||||
*/
|
*/
|
||||||
RCU_INIT_POINTER(obj->fence, new);
|
rcu_assign_pointer(obj->fence, new);
|
||||||
write_seqcount_end(&obj->seq);
|
|
||||||
preempt_enable();
|
|
||||||
|
|
||||||
if (!old)
|
if (!old)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Add table
Reference in a new issue