History

dma-buf: nuke reservation_object seq number

The only remaining use for this is to protect against setting a new exclusive fence while we grab both exclusive and shared. That can also be archived by looking if the exclusive fence has changed or not after completing the operation. v2: switch setting excl fence to rcu_assign_pointer

Christian König committed 7 years ago

Commit 5d344f51 parent d3c6dd12 files · +7 −26Browse files

Showing the changes to include/linux (1 of 2 files). Show all

Unified · Split

include/linux/reservation.h+2−7
@@ -46,8 +46,6 @@ · 45 unmodified lines
46#include <linux/rcupdate.h>46#include <linux/rcupdate.h>
47 47
48extern struct ww_class reservation_ww_class;48extern struct ww_class reservation_ww_class;
49extern struct lock_class_key reservation_seqcount_class;
50extern const char reservation_seqcount_string[];
51 49
52/**50/**
53 * struct reservation_object_list - a list of shared fences51 * struct reservation_object_list - a list of shared fences
@@ -71,7 +69,6 @@ struct reservation_object_list { · 17 unmodified lines
71 */69 */
72struct reservation_object {70struct reservation_object {
73 struct ww_mutex lock;71 struct ww_mutex lock;
74 seqcount_t seq;
75 72
76 struct dma_fence __rcu *fence_excl;73 struct dma_fence __rcu *fence_excl;
77 struct reservation_object_list __rcu *fence;74 struct reservation_object_list __rcu *fence;
@@ -130,14 +127,12 @@ reservation_object_fences(struct reservation_object *obj, · 52 unmodified lines
130 struct reservation_object_list **list,127 struct reservation_object_list **list,
131 u32 *shared_count)128 u32 *shared_count)
132{129{
133 unsigned int seq;
134
135 do {130 do {
136 seq = read_seqcount_begin(&obj->seq);
137 *excl = rcu_dereference(obj->fence_excl);131 *excl = rcu_dereference(obj->fence_excl);
138 *list = rcu_dereference(obj->fence);132 *list = rcu_dereference(obj->fence);
139 *shared_count = *list ? (*list)->shared_count : 0;133 *shared_count = *list ? (*list)->shared_count : 0;
140 } while (read_seqcount_retry(&obj->seq, seq));134 smp_rmb(); /* See reservation_object_add_excl_fence */
135 } while (rcu_access_pointer(obj->fence_excl) != *excl);
141}136}
142 137
143/**138/**

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t