Skip to content

Commit c6b9d9a

Browse files
osandovIngo Molnar
authored andcommitted
sched/wait: Fix add_wait_queue() behavioral change
The following cleanup commit: 50816c4 ("sched/wait: Standardize internal naming of wait-queue entries") ... unintentionally changed the behavior of add_wait_queue() from inserting the wait entry at the head of the wait queue to the tail of the wait queue. Beyond a negative performance impact this change in behavior theoretically also breaks wait queues which mix exclusive and non-exclusive waiters, as non-exclusive waiters will not be woken up if they are queued behind enough exclusive waiters. Signed-off-by: Omar Sandoval <[email protected]> Reviewed-by: Jens Axboe <[email protected]> Acked-by: Peter Zijlstra <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: [email protected] Fixes: ("sched/wait: Standardize internal naming of wait-queue entries") Link: http://lkml.kernel.org/r/a16c8ccffd39bd08fdaa45a5192294c784b803a7.1512544324.git.osandov@fb.com Signed-off-by: Ingo Molnar <[email protected]>
1 parent 328b4ed commit c6b9d9a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/sched/wait.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ void add_wait_queue(struct wait_queue_head *wq_head, struct wait_queue_entry *wq
2727

2828
wq_entry->flags &= ~WQ_FLAG_EXCLUSIVE;
2929
spin_lock_irqsave(&wq_head->lock, flags);
30-
__add_wait_queue_entry_tail(wq_head, wq_entry);
30+
__add_wait_queue(wq_head, wq_entry);
3131
spin_unlock_irqrestore(&wq_head->lock, flags);
3232
}
3333
EXPORT_SYMBOL(add_wait_queue);

0 commit comments

Comments
 (0)