diff options
author | Davidlohr Bueso <dave@stgolabs.net> | 2017-09-08 19:15:01 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-09-08 21:26:49 -0400 |
commit | a23ba907d5e65d6aeea3e59c82fda9cd206a7aad (patch) | |
tree | a0bd42b27596cf758517fa004d1d8681a7eef932 /kernel/locking/rtmutex_common.h | |
parent | 2161573ecd6931565936cb66793b2d2bf805c088 (diff) |
locking/rtmutex: replace top-waiter and pi_waiters leftmost caching
... with the generic rbtree flavor instead. No changes
in semantics whatsoever.
Link: http://lkml.kernel.org/r/20170719014603.19029-10-dave@stgolabs.net
Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/locking/rtmutex_common.h')
-rw-r--r-- | kernel/locking/rtmutex_common.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/kernel/locking/rtmutex_common.h b/kernel/locking/rtmutex_common.h index 8d039b928d61..7453be0485a5 100644 --- a/kernel/locking/rtmutex_common.h +++ b/kernel/locking/rtmutex_common.h | |||
@@ -45,7 +45,7 @@ struct rt_mutex_waiter { | |||
45 | 45 | ||
46 | static inline int rt_mutex_has_waiters(struct rt_mutex *lock) | 46 | static inline int rt_mutex_has_waiters(struct rt_mutex *lock) |
47 | { | 47 | { |
48 | return !RB_EMPTY_ROOT(&lock->waiters); | 48 | return !RB_EMPTY_ROOT(&lock->waiters.rb_root); |
49 | } | 49 | } |
50 | 50 | ||
51 | static inline struct rt_mutex_waiter * | 51 | static inline struct rt_mutex_waiter * |
@@ -53,8 +53,8 @@ rt_mutex_top_waiter(struct rt_mutex *lock) | |||
53 | { | 53 | { |
54 | struct rt_mutex_waiter *w; | 54 | struct rt_mutex_waiter *w; |
55 | 55 | ||
56 | w = rb_entry(lock->waiters_leftmost, struct rt_mutex_waiter, | 56 | w = rb_entry(lock->waiters.rb_leftmost, |
57 | tree_entry); | 57 | struct rt_mutex_waiter, tree_entry); |
58 | BUG_ON(w->lock != lock); | 58 | BUG_ON(w->lock != lock); |
59 | 59 | ||
60 | return w; | 60 | return w; |
@@ -62,14 +62,14 @@ rt_mutex_top_waiter(struct rt_mutex *lock) | |||
62 | 62 | ||
63 | static inline int task_has_pi_waiters(struct task_struct *p) | 63 | static inline int task_has_pi_waiters(struct task_struct *p) |
64 | { | 64 | { |
65 | return !RB_EMPTY_ROOT(&p->pi_waiters); | 65 | return !RB_EMPTY_ROOT(&p->pi_waiters.rb_root); |
66 | } | 66 | } |
67 | 67 | ||
68 | static inline struct rt_mutex_waiter * | 68 | static inline struct rt_mutex_waiter * |
69 | task_top_pi_waiter(struct task_struct *p) | 69 | task_top_pi_waiter(struct task_struct *p) |
70 | { | 70 | { |
71 | return rb_entry(p->pi_waiters_leftmost, struct rt_mutex_waiter, | 71 | return rb_entry(p->pi_waiters.rb_leftmost, |
72 | pi_tree_entry); | 72 | struct rt_mutex_waiter, pi_tree_entry); |
73 | } | 73 | } |
74 | 74 | ||
75 | #else | 75 | #else |