Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752342AbdLFUd2 (ORCPT ); Wed, 6 Dec 2017 15:33:28 -0500 Received: from terminus.zytor.com ([65.50.211.136]:37973 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752121AbdLFUd1 (ORCPT ); Wed, 6 Dec 2017 15:33:27 -0500 Date: Wed, 6 Dec 2017 12:28:53 -0800 From: tip-bot for Omar Sandoval Message-ID: Cc: tglx@linutronix.de, peterz@infradead.org, torvalds@linux-foundation.org, hpa@zytor.com, axboe@kernel.dk, linux-kernel@vger.kernel.org, mingo@kernel.org, osandov@fb.com Reply-To: linux-kernel@vger.kernel.org, mingo@kernel.org, osandov@fb.com, torvalds@linux-foundation.org, hpa@zytor.com, axboe@kernel.dk, peterz@infradead.org, tglx@linutronix.de In-Reply-To: References: To: linux-tip-commits@vger.kernel.org Subject: [tip:sched/core] sched/wait: Fix add_wait_queue() behavioral change Git-Commit-ID: c6b9d9a33029014446bd9ed84c1688f6d3d4eab9 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1917 Lines: 48 Commit-ID: c6b9d9a33029014446bd9ed84c1688f6d3d4eab9 Gitweb: https://git.kernel.org/tip/c6b9d9a33029014446bd9ed84c1688f6d3d4eab9 Author: Omar Sandoval AuthorDate: Tue, 5 Dec 2017 23:15:31 -0800 Committer: Ingo Molnar CommitDate: Wed, 6 Dec 2017 19:30:34 +0100 sched/wait: Fix add_wait_queue() behavioral change The following cleanup commit: 50816c48997a ("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 Reviewed-by: Jens Axboe Acked-by: Peter Zijlstra Cc: Linus Torvalds Cc: Thomas Gleixner Cc: kernel-team@fb.com 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 --- kernel/sched/wait.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/wait.c b/kernel/sched/wait.c index 98feab7..929ecb7 100644 --- a/kernel/sched/wait.c +++ b/kernel/sched/wait.c @@ -27,7 +27,7 @@ void add_wait_queue(struct wait_queue_head *wq_head, struct wait_queue_entry *wq wq_entry->flags &= ~WQ_FLAG_EXCLUSIVE; spin_lock_irqsave(&wq_head->lock, flags); - __add_wait_queue_entry_tail(wq_head, wq_entry); + __add_wait_queue(wq_head, wq_entry); spin_unlock_irqrestore(&wq_head->lock, flags); } EXPORT_SYMBOL(add_wait_queue);