]>
Commit | Line | Data |
---|---|---|
ef812b06 FG |
1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 |
2 | From: Omar Sandoval <osandov@fb.com> | |
3 | Date: Tue, 5 Dec 2017 23:15:31 -0800 | |
4 | Subject: [PATCH] sched/wait: Fix add_wait_queue() behavioral change | |
5 | MIME-Version: 1.0 | |
6 | Content-Type: text/plain; charset=UTF-8 | |
7 | Content-Transfer-Encoding: 8bit | |
8 | ||
9 | The following cleanup commit: | |
10 | ||
11 | 50816c48997a ("sched/wait: Standardize internal naming of wait-queue entries") | |
12 | ||
13 | ... unintentionally changed the behavior of add_wait_queue() from | |
14 | inserting the wait entry at the head of the wait queue to the tail | |
15 | of the wait queue. | |
16 | ||
17 | Beyond a negative performance impact this change in behavior | |
18 | theoretically also breaks wait queues which mix exclusive and | |
19 | non-exclusive waiters, as non-exclusive waiters will not be | |
20 | woken up if they are queued behind enough exclusive waiters. | |
21 | ||
22 | Signed-off-by: Omar Sandoval <osandov@fb.com> | |
23 | Reviewed-by: Jens Axboe <axboe@kernel.dk> | |
24 | Acked-by: Peter Zijlstra <peterz@infradead.org> | |
25 | Cc: Linus Torvalds <torvalds@linux-foundation.org> | |
26 | Cc: Thomas Gleixner <tglx@linutronix.de> | |
27 | Cc: kernel-team@fb.com | |
28 | Fixes: ("sched/wait: Standardize internal naming of wait-queue entries") | |
29 | Link: http://lkml.kernel.org/r/a16c8ccffd39bd08fdaa45a5192294c784b803a7.1512544324.git.osandov@fb.com | |
30 | Signed-off-by: Ingo Molnar <mingo@kernel.org> | |
31 | (cherry picked from commit c6b9d9a33029014446bd9ed84c1688f6d3d4eab9) | |
32 | Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com> | |
33 | --- | |
34 | kernel/sched/wait.c | 2 +- | |
35 | 1 file changed, 1 insertion(+), 1 deletion(-) | |
36 | ||
37 | diff --git a/kernel/sched/wait.c b/kernel/sched/wait.c | |
38 | index d6afed6d0752..c09ebe92a40a 100644 | |
39 | --- a/kernel/sched/wait.c | |
40 | +++ b/kernel/sched/wait.c | |
41 | @@ -27,7 +27,7 @@ void add_wait_queue(struct wait_queue_head *wq_head, struct wait_queue_entry *wq | |
42 | ||
43 | wq_entry->flags &= ~WQ_FLAG_EXCLUSIVE; | |
44 | spin_lock_irqsave(&wq_head->lock, flags); | |
45 | - __add_wait_queue_entry_tail(wq_head, wq_entry); | |
46 | + __add_wait_queue(wq_head, wq_entry); | |
47 | spin_unlock_irqrestore(&wq_head->lock, flags); | |
48 | } | |
49 | EXPORT_SYMBOL(add_wait_queue); |