Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp575073imu; Thu, 20 Dec 2018 01:39:49 -0800 (PST) X-Google-Smtp-Source: AFSGD/V6bOgKUrgg3mSJZVSUteIyo4B/sGHW9g9IFStyc5o1uHQ3aWCa1lvDW6u4sYlV+lxnJMtP X-Received: by 2002:a62:d005:: with SMTP id p5mr23667439pfg.175.1545298789039; Thu, 20 Dec 2018 01:39:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545298789; cv=none; d=google.com; s=arc-20160816; b=mp3qDPTWzvt7A5L+MPCqckz97lxt2DIt97XNhuxzrDIEKo1uUelRk8IDCsU3UxzJiv V4ABrkOxMNML4xlqyCCkrVe0KXpFb+Wg4qnPIuyRWO+FKRyW748fmhhMh5j/iGeR/EJF njKW8wSPKuqB1wQ2kEJytMqLuq8zvZnxgxDHzR9UWzTJPBA/kXHyyN8VY3D9ImeW4CjG kE5G/WowEBLkKvbEMbfNwo5EExJ+fvLqzQQrPVwLgORT/ACnZnQC4rpLvXtMjxzYJfyI JwWIJ1xxKnzZJnYpndLQNKYnrPosenXNtBQRlW4wtIVnAw+/D5UI9Q+A8Foaq2mWgAqr mC8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=CCuBjS4Vf+bDTNitCdUZcc1e66VYvnilqAEG+HZCLaM=; b=Fv9kBUKL3c9PVKjt6e2TX0CroZJ44b5YaivlSec6r/ZSEWL6hodkU8/TqsbNhthQug V9iTDrQRG5AgOR3KK1xFLdSSiE7kAXCndprIEWUJn70tw0St4dErMATIy+QEYRONQb0R 48oqcqEjLhcO1a4kaexEBmmBBPJh7zwG3N1cTNBVl09qYXzGYpQCtG6uoyND+hC6Eob/ tUhwFbeNyE+FHn9t+BMyTNx3oepyOTYyI4IwkwZnz5w0jbeDaAtcZqrcJqyk3h52r/lr cNuXfnzBIMKgesacU/m5qFzskU67Y335tamIB+gf5qPNjnZsBPhAPYEg84xQ6Thtgjdl aBHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=zqI0uXoM; 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 k186si18888257pgc.576.2018.12.20.01.39.33; Thu, 20 Dec 2018 01:39:48 -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; dkim=pass header.i=@kernel.org header.s=default header.b=zqI0uXoM; 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 S1732276AbeLTJ1P (ORCPT + 99 others); Thu, 20 Dec 2018 04:27:15 -0500 Received: from mail.kernel.org ([198.145.29.99]:34022 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730026AbeLTJ1L (ORCPT ); Thu, 20 Dec 2018 04:27:11 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2D15B21741; Thu, 20 Dec 2018 09:27:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1545298030; bh=BeS2+wPT5J7OU323vln46527eYsRVsS3gmsvUTEH/u4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zqI0uXoMVsEMVfI7gfGIV+gTr0Kjuthv53UqdaC8dwZDXRqsxzfkMRoRGqxeEX65b u9ycwBIKOVXqsf8MSlCHQZyvbeX/14CW71M/lrC8Y6U3wawn4vMY6VcUlwcuPGo2Sx STPPp1gSYRcYAzoiCQIObyGRoZBX3Fl+oUTFf/5k= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Waiman Long , Will Deacon , "Peter Zijlstra (Intel)" , Linus Torvalds , Thomas Gleixner , boqun.feng@gmail.com, linux-arm-kernel@lists.infradead.org, paulmck@linux.vnet.ibm.com, Ingo Molnar , Sebastian Andrzej Siewior , Sasha Levin Subject: [PATCH 4.14 28/72] locking/qspinlock/x86: Increase _Q_PENDING_LOOPS upper bound Date: Thu, 20 Dec 2018 10:18:27 +0100 Message-Id: <20181220085923.447185200@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20181220085922.332225035@linuxfoundation.org> References: <20181220085922.332225035@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. ------------------ commit b247be3fe89b6aba928bf80f4453d1c4ba8d2063 upstream. On x86, atomic_cond_read_relaxed will busy-wait with a cpu_relax() loop, so it is desirable to increase the number of times we spin on the qspinlock lockword when it is found to be transitioning from pending to locked. According to Waiman Long: | Ideally, the spinning times should be at least a few times the typical | cacheline load time from memory which I think can be down to 100ns or | so for each cacheline load with the newest systems or up to several | hundreds ns for older systems. which in his benchmarking corresponded to 512 iterations. Suggested-by: Waiman Long Signed-off-by: Will Deacon Acked-by: Peter Zijlstra (Intel) Acked-by: Waiman Long Cc: Linus Torvalds Cc: Thomas Gleixner Cc: boqun.feng@gmail.com Cc: linux-arm-kernel@lists.infradead.org Cc: paulmck@linux.vnet.ibm.com Link: http://lkml.kernel.org/r/1524738868-31318-5-git-send-email-will.deacon@arm.com Signed-off-by: Ingo Molnar Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Sasha Levin --- arch/x86/include/asm/qspinlock.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/x86/include/asm/qspinlock.h b/arch/x86/include/asm/qspinlock.h index cf4cdf508ef4..2cb6624acaec 100644 --- a/arch/x86/include/asm/qspinlock.h +++ b/arch/x86/include/asm/qspinlock.h @@ -6,6 +6,8 @@ #include #include +#define _Q_PENDING_LOOPS (1 << 9) + #define queued_spin_unlock queued_spin_unlock /** * queued_spin_unlock - release a queued spinlock -- 2.19.1