diff options
Diffstat (limited to 'kernel/locking/rtmutex_common.h')
-rw-r--r-- | kernel/locking/rtmutex_common.h | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/kernel/locking/rtmutex_common.h b/kernel/locking/rtmutex_common.h index 53a66c85261b..7431a9c86f35 100644 --- a/kernel/locking/rtmutex_common.h +++ b/kernel/locking/rtmutex_common.h | |||
@@ -40,13 +40,13 @@ extern void schedule_rt_mutex_test(struct rt_mutex *lock); | |||
40 | * This is the control structure for tasks blocked on a rt_mutex, | 40 | * This is the control structure for tasks blocked on a rt_mutex, |
41 | * which is allocated on the kernel stack on of the blocked task. | 41 | * which is allocated on the kernel stack on of the blocked task. |
42 | * | 42 | * |
43 | * @list_entry: pi node to enqueue into the mutex waiters list | 43 | * @tree_entry: pi node to enqueue into the mutex waiters tree |
44 | * @pi_list_entry: pi node to enqueue into the mutex owner waiters list | 44 | * @pi_tree_entry: pi node to enqueue into the mutex owner waiters tree |
45 | * @task: task reference to the blocked task | 45 | * @task: task reference to the blocked task |
46 | */ | 46 | */ |
47 | struct rt_mutex_waiter { | 47 | struct rt_mutex_waiter { |
48 | struct plist_node list_entry; | 48 | struct rb_node tree_entry; |
49 | struct plist_node pi_list_entry; | 49 | struct rb_node pi_tree_entry; |
50 | struct task_struct *task; | 50 | struct task_struct *task; |
51 | struct rt_mutex *lock; | 51 | struct rt_mutex *lock; |
52 | #ifdef CONFIG_DEBUG_RT_MUTEXES | 52 | #ifdef CONFIG_DEBUG_RT_MUTEXES |
@@ -54,14 +54,15 @@ struct rt_mutex_waiter { | |||
54 | struct pid *deadlock_task_pid; | 54 | struct pid *deadlock_task_pid; |
55 | struct rt_mutex *deadlock_lock; | 55 | struct rt_mutex *deadlock_lock; |
56 | #endif | 56 | #endif |
57 | int prio; | ||
57 | }; | 58 | }; |
58 | 59 | ||
59 | /* | 60 | /* |
60 | * Various helpers to access the waiters-plist: | 61 | * Various helpers to access the waiters-tree: |
61 | */ | 62 | */ |
62 | static inline int rt_mutex_has_waiters(struct rt_mutex *lock) | 63 | static inline int rt_mutex_has_waiters(struct rt_mutex *lock) |
63 | { | 64 | { |
64 | return !plist_head_empty(&lock->wait_list); | 65 | return !RB_EMPTY_ROOT(&lock->waiters); |
65 | } | 66 | } |
66 | 67 | ||
67 | static inline struct rt_mutex_waiter * | 68 | static inline struct rt_mutex_waiter * |
@@ -69,8 +70,8 @@ rt_mutex_top_waiter(struct rt_mutex *lock) | |||
69 | { | 70 | { |
70 | struct rt_mutex_waiter *w; | 71 | struct rt_mutex_waiter *w; |
71 | 72 | ||
72 | w = plist_first_entry(&lock->wait_list, struct rt_mutex_waiter, | 73 | w = rb_entry(lock->waiters_leftmost, struct rt_mutex_waiter, |
73 | list_entry); | 74 | tree_entry); |
74 | BUG_ON(w->lock != lock); | 75 | BUG_ON(w->lock != lock); |
75 | 76 | ||
76 | return w; | 77 | return w; |
@@ -78,14 +79,14 @@ rt_mutex_top_waiter(struct rt_mutex *lock) | |||
78 | 79 | ||
79 | static inline int task_has_pi_waiters(struct task_struct *p) | 80 | static inline int task_has_pi_waiters(struct task_struct *p) |
80 | { | 81 | { |
81 | return !plist_head_empty(&p->pi_waiters); | 82 | return !RB_EMPTY_ROOT(&p->pi_waiters); |
82 | } | 83 | } |
83 | 84 | ||
84 | static inline struct rt_mutex_waiter * | 85 | static inline struct rt_mutex_waiter * |
85 | task_top_pi_waiter(struct task_struct *p) | 86 | task_top_pi_waiter(struct task_struct *p) |
86 | { | 87 | { |
87 | return plist_first_entry(&p->pi_waiters, struct rt_mutex_waiter, | 88 | return rb_entry(p->pi_waiters_leftmost, struct rt_mutex_waiter, |
88 | pi_list_entry); | 89 | pi_tree_entry); |
89 | } | 90 | } |
90 | 91 | ||
91 | /* | 92 | /* |