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
4646 #include <linux/rcupdate.h>
4747
4848 extern struct ww_class reservation_ww_class;
49−extern struct lock_class_key reservation_seqcount_class;
50−extern const char reservation_seqcount_string[];
5149
5250 /**
5351 * struct reservation_object_list - a list of shared fences
@@ -71,7 +69,6 @@ struct reservation_object_list { · 17 unmodified lines
7169 */
7270 struct reservation_object {
7371 struct ww_mutex lock;
74− seqcount_t seq;
7572
7673 struct dma_fence __rcu *fence_excl;
7774 struct reservation_object_list __rcu *fence;
@@ -130,14 +127,12 @@ reservation_object_fences(struct reservation_object *obj, · 52 unmodified lines
130127 struct reservation_object_list **list,
131128 u32 *shared_count)
132129 {
133− unsigned int seq;
134−
135130 do {
136− seq = read_seqcount_begin(&obj->seq);
137131 *excl = rcu_dereference(obj->fence_excl);
138132 *list = rcu_dereference(obj->fence);
139133 *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);
141136 }
142137
143138 /**

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