]> git.proxmox.com Git - pve-kernel.git/blame - patches/kernel/0014-sched-wait-Fix-add_wait_queue-behavioral-change.patch
update sources to Ubuntu-4.13.0-45.50
[pve-kernel.git] / patches / kernel / 0014-sched-wait-Fix-add_wait_queue-behavioral-change.patch
CommitLineData
ef812b06
FG
1From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2From: Omar Sandoval <osandov@fb.com>
3Date: Tue, 5 Dec 2017 23:15:31 -0800
4Subject: [PATCH] sched/wait: Fix add_wait_queue() behavioral change
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9The 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
14inserting the wait entry at the head of the wait queue to the tail
15of the wait queue.
16
17Beyond a negative performance impact this change in behavior
18theoretically also breaks wait queues which mix exclusive and
19non-exclusive waiters, as non-exclusive waiters will not be
20woken up if they are queued behind enough exclusive waiters.
21
22Signed-off-by: Omar Sandoval <osandov@fb.com>
23Reviewed-by: Jens Axboe <axboe@kernel.dk>
24Acked-by: Peter Zijlstra <peterz@infradead.org>
25Cc: Linus Torvalds <torvalds@linux-foundation.org>
26Cc: Thomas Gleixner <tglx@linutronix.de>
27Cc: kernel-team@fb.com
28Fixes: ("sched/wait: Standardize internal naming of wait-queue entries")
29Link: http://lkml.kernel.org/r/a16c8ccffd39bd08fdaa45a5192294c784b803a7.1512544324.git.osandov@fb.com
30Signed-off-by: Ingo Molnar <mingo@kernel.org>
31(cherry picked from commit c6b9d9a33029014446bd9ed84c1688f6d3d4eab9)
32Signed-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
37diff --git a/kernel/sched/wait.c b/kernel/sched/wait.c
38index 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);
50--
512.14.2
52