Received: by 10.223.185.116 with SMTP id b49csp2330856wrg; Thu, 15 Feb 2018 09:57:35 -0800 (PST) X-Google-Smtp-Source: AH8x226+uZDJ666H0mYh976YtmUk5YeRAf19JzGeH2MhQ5Rqz+NVi6zta5oAOItWo3vvwHB2WAES X-Received: by 2002:a17:902:d806:: with SMTP id a6-v6mr3250760plz.274.1518717455351; Thu, 15 Feb 2018 09:57:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518717455; cv=none; d=google.com; s=arc-20160816; b=bBB71IPF1S2/X8P25uvKZ5FKmokK7f60zZauic8iU8TBjLZZktnVqYLRCVMG8DUU6J 0dG9Jgr2AM3nnyiou6WLNokSancunZ07jnC8DrZQrw17qIH2l/KaA+zzDIKCRbSh73xF dd3adDNl+DwGHonKwtQvGuZS19VofmDBqxR7W8Y6hDXkf3A0svlabl2fAc3xgbVBw+QW DpCqvSzHb/5WM9/iq1KPxgvY/YCiRkTVjg/X0N64SGM4Jb7wTCiKncCZoBvorYrQTLF0 gsEKKkdw56FUpT0U03omK8CsA2/vc38Lnk7kuj+d5OQtE+tPmKaNK6h4IaKGov1WS78R g1bA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=wFJWLcbmfPTfVsYuDcFvDmbx69VaJEx1J0U0Ax95blQ=; b=yB3ZfC5s9TiRybmKP2oTrWeGPzzSz61UxpUxCmfNsEDQEKggS/n8qiuzc2Pp2U5Sh/ j4BsAQ6tyumNV4a0oNOkwngU1nWIDuMWMg8R8EYQklH9eNQwA5zmEXsoj+LIcY7wlkmm eHuRSF6enuj1jbrclEvxw8luk0AQPSaIwhTpXu4Zy2q/2K7b8Y0GUnIzoCUhQ0HY4P68 w1ZaTgjNkRVFaMO2jIj/7KpAHT9XMgBuOZmhQY0EcW/4xR2No7MKPz/JzRhXtNgxH/Ni ai22ecOgiPF0xu12hF0XLXOU1Moiw7Pam+4mZA0Q9ytf1xhge/gjrypSYlttwcF+EdXu 8z1g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b2-v6si1917476plr.656.2018.02.15.09.57.20; Thu, 15 Feb 2018 09:57:35 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1164185AbeBOPaO (ORCPT + 99 others); Thu, 15 Feb 2018 10:30:14 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:54946 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1163719AbeBOPaK (ORCPT ); Thu, 15 Feb 2018 10:30:10 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id E133C110E; Thu, 15 Feb 2018 15:30:09 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Omar Sandoval , Jens Axboe , Peter Zijlstra , Linus Torvalds , Thomas Gleixner , kernel-team@fb.com, Ingo Molnar Subject: [PATCH 4.14 008/195] sched/wait: Fix add_wait_queue() behavioral change Date: Thu, 15 Feb 2018 16:14:59 +0100 Message-Id: <20180215151706.164372057@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180215151705.738773577@linuxfoundation.org> References: <20180215151705.738773577@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Omar Sandoval commit c6b9d9a33029014446bd9ed84c1688f6d3d4eab9 upstream. 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 Signed-off-by: Greg Kroah-Hartman --- kernel/sched/wait.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/kernel/sched/wait.c +++ b/kernel/sched/wait.c @@ -27,7 +27,7 @@ void add_wait_queue(struct wait_queue_he 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);