From patchwork Tue Oct 30 17:19:22 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paul E. McKenney" X-Patchwork-Id: 12619 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 6182A23F56 for ; Tue, 30 Oct 2012 17:33:02 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id 14AB5A18890 for ; Tue, 30 Oct 2012 17:33:01 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so754766iej.11 for ; Tue, 30 Oct 2012 10:33:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-content-scanned:x-cbid:x-gm-message-state; bh=1CP0JoRGJH8/BxsJJK4oAM6tEWdORKVfWzDEmoOop7c=; b=b7pGwsfT25VmeZeECydsBIXf7qnCD2Jni/0t7fpOz2AxEoqqdNmQ02bw+xWtYbYGYh oUP1q84OznXlHPl7ZRnZUIY2ScUOKED73WjAXdNgLTwVZBdrFi5YUkiSeZDyPeG1BJjX 6kD5yeAq7lkh1dzMPnoHu8ZFlxEU7BpQAYFkpXSnMjClDHHshJjyGM8fHanWnj+MP0fR 5ixNdbB42LP3lVyDqUskJZPkVvxAIhaUYhRyD0MQGD14lAlOJhQUZkGo8UC2vsRUSK4R lPYyaaLLDy5eNvOGt0JDQYsQCqMAOjYxBTedgGXd5c8dGKA2cZE+K5ACWupJUhu2xtDw FCnA== Received: by 10.50.88.233 with SMTP id bj9mr2168060igb.70.1351618381823; Tue, 30 Oct 2012 10:33:01 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.67.148 with SMTP id n20csp457853igt; Tue, 30 Oct 2012 10:33:01 -0700 (PDT) Received: by 10.50.184.229 with SMTP id ex5mr2212455igc.72.1351618381549; Tue, 30 Oct 2012 10:33:01 -0700 (PDT) Received: from e36.co.us.ibm.com (e36.co.us.ibm.com. [32.97.110.154]) by mx.google.com with ESMTPS id ej5si1347161icb.26.2012.10.30.10.33.01 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 30 Oct 2012 10:33:01 -0700 (PDT) Received-SPF: pass (google.com: domain of paulmck@linux.vnet.ibm.com designates 32.97.110.154 as permitted sender) client-ip=32.97.110.154; Authentication-Results: mx.google.com; spf=pass (google.com: domain of paulmck@linux.vnet.ibm.com designates 32.97.110.154 as permitted sender) smtp.mail=paulmck@linux.vnet.ibm.com Received: from /spool/local by e36.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 30 Oct 2012 11:33:00 -0600 Received: from d03dlp03.boulder.ibm.com (9.17.202.179) by e36.co.us.ibm.com (192.168.1.136) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 30 Oct 2012 11:32:45 -0600 Received: from d03relay05.boulder.ibm.com (d03relay05.boulder.ibm.com [9.17.195.107]) by d03dlp03.boulder.ibm.com (Postfix) with ESMTP id 576D719D803F; Tue, 30 Oct 2012 11:32:42 -0600 (MDT) Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.195.167]) by d03relay05.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q9UHWU5T088586; Tue, 30 Oct 2012 11:32:32 -0600 Received: from d03av01.boulder.ibm.com (loopback [127.0.0.1]) by d03av01.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q9UHVb7i027736; Tue, 30 Oct 2012 11:31:38 -0600 Received: from paulmck-ThinkPad-W500 (sig-9-49-139-14.mts.ibm.com [9.49.139.14]) by d03av01.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q9UHVZE7027427; Tue, 30 Oct 2012 11:31:36 -0600 Received: by paulmck-ThinkPad-W500 (Postfix, from userid 1000) id 2F567EBEEC; Tue, 30 Oct 2012 10:19:25 -0700 (PDT) From: "Paul E. McKenney" To: linux-kernel@vger.kernel.org Cc: mingo@elte.hu, laijs@cn.fujitsu.com, dipankar@in.ibm.com, akpm@linux-foundation.org, mathieu.desnoyers@polymtl.ca, josh@joshtriplett.org, niv@us.ibm.com, tglx@linutronix.de, peterz@infradead.org, rostedt@goodmis.org, Valdis.Kletnieks@vt.edu, dhowells@redhat.com, edumazet@google.com, darren@dvhart.com, fweisbec@gmail.com, sbw@mit.edu, patches@linaro.org, "Paul E. McKenney" , "Paul E. McKenney" Subject: [PATCH tip/core/rcu 4/5] rcu: Fix precedence error in cpu_needs_another_gp() Date: Tue, 30 Oct 2012 10:19:22 -0700 Message-Id: <1351617563-28506-4-git-send-email-paulmck@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.8 In-Reply-To: <1351617563-28506-1-git-send-email-paulmck@linux.vnet.ibm.com> References: <20121030171906.GA27431@linux.vnet.ibm.com> <1351617563-28506-1-git-send-email-paulmck@linux.vnet.ibm.com> X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12103017-7606-0000-0000-000004EEB2E4 X-Gm-Message-State: ALoCoQlJEu47lmToVyrKS5CUfrTbHbbKk4jKT9NVtzFT4xYKmNcAnsg/bqfCinQgmJAggBRIbFEK From: "Paul E. McKenney" The fix introduced by a10d206e (rcu: Fix day-one dyntick-idle stall-warning bug) has a C-language precedence error. It turns out that this error is harmless in that the same result is computed for all inputs, but the code is nevertheless a potential source of confusion. This commit therefore introduces parentheses in order to force the execution of the code to reflect the intent. Reported-by: Ben Hutchings Signed-off-by: Paul E. McKenney Signed-off-by: Paul E. McKenney --- kernel/rcutree.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/kernel/rcutree.c b/kernel/rcutree.c index f9c17c3..effd47a 100644 --- a/kernel/rcutree.c +++ b/kernel/rcutree.c @@ -313,7 +313,7 @@ static int cpu_needs_another_gp(struct rcu_state *rsp, struct rcu_data *rdp) { return *rdp->nxttail[RCU_DONE_TAIL + - ACCESS_ONCE(rsp->completed) != rdp->completed] && + (ACCESS_ONCE(rsp->completed) != rdp->completed)] && !rcu_gp_in_progress(rsp); }