From patchwork Tue Dec 18 22:10:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Andrzej Siewior X-Patchwork-Id: 154218 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp4236541ljp; Tue, 18 Dec 2018 14:11:35 -0800 (PST) X-Google-Smtp-Source: AFSGD/Vd1QaRhVJQLjWR2GY94WuNZ1NBk3weMrDYtzgg0+MwCosPQFQjiT0X4f/mLvK1PIZ5aLas X-Received: by 2002:a17:902:2aaa:: with SMTP id j39mr18466305plb.335.1545171094961; Tue, 18 Dec 2018 14:11:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545171094; cv=none; d=google.com; s=arc-20160816; b=iPgzdhX1iNtC3ciNe6y9w3e96Lsn1VJeOapzAM+cIm9B2+MLut7wXe1lCPnDjIeBAn M2i9NRt+Hl5tRYKDOIBHOXy6DVeSrn7vbeug3WMGO2WtshGg6ck9kbYULH+/VLeJO6vE ANFT4Xtc3U9CcRs5USdslYTIq3TNAig7CB0O8k1aNVUbPkKR8pTS5nqxwRrJ66hhR5+6 5anlNxdi04ybVcvT+Buc8S6FymbIXdJoFYaWVJAXFc3jDmlwMS9yjJsj30lux7GvJDHA WEOl34GuxtbMQHxrq5B/v3Wft0Xw+WCz3cYnNSzmk+bjg7/b4neah+VI605hHCqA1KJN Nodw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=C4QOmC+4HCVv0U1au3HqqAg7kCaRfGMUZHvuCAhzEoQ=; b=Zcyanx+DnXkHsye0SnYxClow0irsIqp0GzA1tlWBcwLIIYfvloiI4PcCYNOp+g4VRM 8K87mLUpSK3AwG1KvIV1a0zq8oa7Fhnlj72IP3elgvRcg1V3uWAhi1XlDg/tCL5OHcUt lVsD3PP7ZrbydHJD/hqAnxzWyF14tuC7denyN40xmpJb5PAoeTyBbdOiMIzZ8C/mbAWX HEiV9JXIcOTa1nnqBW5z2hvdRvLH+0O+lmJ13qu3VbcQ5Yh/Jll2WaCpx/q4bqeXt7uS 5ZDB+7/rSVpGLneSbALm0ylnWSO7UshBzzQsXdMHyTSaixIKi+NmScLpaK2L8YCRI/bZ O6jQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 c8si13817215pgl.507.2018.12.18.14.11.34; Tue, 18 Dec 2018 14:11:34 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-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 stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727464AbeLRWLd (ORCPT + 15 others); Tue, 18 Dec 2018 17:11:33 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:57234 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727760AbeLRWLd (ORCPT ); Tue, 18 Dec 2018 17:11:33 -0500 Received: from localhost ([127.0.0.1] helo=bazinga.breakpoint.cc) by Galois.linutronix.de with esmtp (Exim 4.80) (envelope-from ) id 1gZNaJ-000889-Bq; Tue, 18 Dec 2018 23:11:27 +0100 From: Sebastian Andrzej Siewior To: stable@vger.kernel.org Cc: Peter Zijlstra , Will Deacon , Thomas Gleixner , Daniel Wagner , bigeasy@linutronix.de, Waiman Long , Linus Torvalds , boqun.feng@gmail.com, linux-arm-kernel@lists.infradead.org, paulmck@linux.vnet.ibm.com, Ingo Molnar Subject: [PATCH STABLE v4.9 09/10] locking/qspinlock/x86: Increase _Q_PENDING_LOOPS upper bound Date: Tue, 18 Dec 2018 23:10:48 +0100 Message-Id: <20181218221049.6816-10-bigeasy@linutronix.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20181218221049.6816-1-bigeasy@linutronix.de> References: <20181218221049.6816-1-bigeasy@linutronix.de> MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Will Deacon 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 --- arch/x86/include/asm/qspinlock.h | 2 ++ 1 file changed, 2 insertions(+) -- 2.20.1 diff --git a/arch/x86/include/asm/qspinlock.h b/arch/x86/include/asm/qspinlock.h index e07cc206919d4..8b1ba1607091c 100644 --- a/arch/x86/include/asm/qspinlock.h +++ b/arch/x86/include/asm/qspinlock.h @@ -5,6 +5,8 @@ #include #include +#define _Q_PENDING_LOOPS (1 << 9) + #define queued_spin_unlock queued_spin_unlock /** * queued_spin_unlock - release a queued spinlock