Commit 0e1d8083 authored by Christian König's avatar Christian König

dma-buf: further relax reservation_object_add_shared_fence

Other cores don't busy wait any more and we removed the last user of checking
the seqno for changes. Drop updating the number for shared fences altogether.
Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/322379/?series=64837&rev=1
parent dd7a7d1f
...@@ -237,9 +237,6 @@ void reservation_object_add_shared_fence(struct reservation_object *obj, ...@@ -237,9 +237,6 @@ void reservation_object_add_shared_fence(struct reservation_object *obj,
fobj = reservation_object_get_list(obj); fobj = reservation_object_get_list(obj);
count = fobj->shared_count; count = fobj->shared_count;
preempt_disable();
write_seqcount_begin(&obj->seq);
for (i = 0; i < count; ++i) { for (i = 0; i < count; ++i) {
old = rcu_dereference_protected(fobj->shared[i], old = rcu_dereference_protected(fobj->shared[i],
...@@ -257,9 +254,6 @@ void reservation_object_add_shared_fence(struct reservation_object *obj, ...@@ -257,9 +254,6 @@ void reservation_object_add_shared_fence(struct reservation_object *obj,
RCU_INIT_POINTER(fobj->shared[i], fence); RCU_INIT_POINTER(fobj->shared[i], fence);
/* pointer update must be visible before we extend the shared_count */ /* pointer update must be visible before we extend the shared_count */
smp_store_mb(fobj->shared_count, count); smp_store_mb(fobj->shared_count, count);
write_seqcount_end(&obj->seq);
preempt_enable();
dma_fence_put(old); dma_fence_put(old);
} }
EXPORT_SYMBOL(reservation_object_add_shared_fence); EXPORT_SYMBOL(reservation_object_add_shared_fence);
......
...@@ -251,12 +251,7 @@ static int amdgpu_amdkfd_remove_eviction_fence(struct amdgpu_bo *bo, ...@@ -251,12 +251,7 @@ static int amdgpu_amdkfd_remove_eviction_fence(struct amdgpu_bo *bo,
new->shared_max = old->shared_max; new->shared_max = old->shared_max;
new->shared_count = k; new->shared_count = k;
/* Install the new fence list, seqcount provides the barriers */ rcu_assign_pointer(resv->fence, new);
preempt_disable();
write_seqcount_begin(&resv->seq);
RCU_INIT_POINTER(resv->fence, new);
write_seqcount_end(&resv->seq);
preempt_enable();
/* Drop the references to the removed fences or move them to ef_list */ /* Drop the references to the removed fences or move them to ef_list */
for (i = j, k = 0; i < old->shared_count; ++i) { for (i = j, k = 0; i < old->shared_count; ++i) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment