Commit 78ddb08feb7d4fbe3c0a9931804c51ee58be4023
Committed by
Ingo Molnar
1 parent
e790fb0ba6
Exists in
master
and in
4 other branches
wait: don't use __wake_up_common()
'777c6c5 wait: prevent exclusive waiter starvation' made __wake_up_common() global to be used from abort_exclusive_wait(). It was needed to do a wake-up with the waitqueue lock held while passing down a key to the wake-up function. Since '4ede816 epoll keyed wakeups: add __wake_up_locked_key() and __wake_up_sync_key()' there is an appropriate wrapper for this case: __wake_up_locked_key(). Use it here and make __wake_up_common() private to the scheduler again. Signed-off-by: Johannes Weiner <hannes@cmpxchg.org> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> LKML-Reference: <1239720785-19661-1-git-send-email-hannes@cmpxchg.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Showing 3 changed files with 2 additions and 4 deletions Side-by-side Diff
include/linux/wait.h
... | ... | @@ -132,8 +132,6 @@ |
132 | 132 | list_del(&old->task_list); |
133 | 133 | } |
134 | 134 | |
135 | -void __wake_up_common(wait_queue_head_t *q, unsigned int mode, | |
136 | - int nr_exclusive, int sync, void *key); | |
137 | 135 | void __wake_up(wait_queue_head_t *q, unsigned int mode, int nr, void *key); |
138 | 136 | void __wake_up_locked_key(wait_queue_head_t *q, unsigned int mode, void *key); |
139 | 137 | void __wake_up_sync_key(wait_queue_head_t *q, unsigned int mode, int nr, |
kernel/sched.c
... | ... | @@ -5345,7 +5345,7 @@ |
5345 | 5345 | * started to run but is not in state TASK_RUNNING. try_to_wake_up() returns |
5346 | 5346 | * zero in this (rare) case, and we handle it by continuing to scan the queue. |
5347 | 5347 | */ |
5348 | -void __wake_up_common(wait_queue_head_t *q, unsigned int mode, | |
5348 | +static void __wake_up_common(wait_queue_head_t *q, unsigned int mode, | |
5349 | 5349 | int nr_exclusive, int sync, void *key) |
5350 | 5350 | { |
5351 | 5351 | wait_queue_t *curr, *next; |
kernel/wait.c
... | ... | @@ -154,7 +154,7 @@ |
154 | 154 | if (!list_empty(&wait->task_list)) |
155 | 155 | list_del_init(&wait->task_list); |
156 | 156 | else if (waitqueue_active(q)) |
157 | - __wake_up_common(q, mode, 1, 0, key); | |
157 | + __wake_up_locked_key(q, mode, key); | |
158 | 158 | spin_unlock_irqrestore(&q->lock, flags); |
159 | 159 | } |
160 | 160 | EXPORT_SYMBOL(abort_exclusive_wait); |