From patchwork Tue Mar 1 22:01:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paul E. McKenney" X-Patchwork-Id: 8470791 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 86A76C0553 for ; Tue, 1 Mar 2016 22:01:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8F2D42034A for ; Tue, 1 Mar 2016 22:01:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0B5A0202FF for ; Tue, 1 Mar 2016 22:01:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752103AbcCAWBW (ORCPT ); Tue, 1 Mar 2016 17:01:22 -0500 Received: from e32.co.us.ibm.com ([32.97.110.150]:59329 "EHLO e32.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750768AbcCAWBU (ORCPT ); Tue, 1 Mar 2016 17:01:20 -0500 Received: from localhost by e32.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 1 Mar 2016 15:01:20 -0700 Received: from d03dlp01.boulder.ibm.com (9.17.202.177) by e32.co.us.ibm.com (192.168.1.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 1 Mar 2016 15:01:17 -0700 X-IBM-Helo: d03dlp01.boulder.ibm.com X-IBM-MailFrom: paulmck@linux.vnet.ibm.com X-IBM-RcptTo: linux-acpi@vger.kernel.org; linux-kernel@vger.kernel.org; netdev@vger.kernel.org Received: from b01cxnp22035.gho.pok.ibm.com (b01cxnp22035.gho.pok.ibm.com [9.57.198.25]) by d03dlp01.boulder.ibm.com (Postfix) with ESMTP id 3F5A6C40005; Tue, 1 Mar 2016 14:49:26 -0700 (MST) Received: from d01av01.pok.ibm.com (d01av01.pok.ibm.com [9.56.224.215]) by b01cxnp22035.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u21M1GRf29163662; Tue, 1 Mar 2016 22:01:16 GMT Received: from d01av01.pok.ibm.com (localhost [127.0.0.1]) by d01av01.pok.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u21M1Ckp010684; Tue, 1 Mar 2016 17:01:15 -0500 Received: from paulmck-ThinkPad-W541 (sig-9-65-79-178.ibm.com [9.65.79.178]) by d01av01.pok.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id u21M18df009962; Tue, 1 Mar 2016 17:01:09 -0500 Received: by paulmck-ThinkPad-W541 (Postfix, from userid 1000) id 97C9516C2DBE; Tue, 1 Mar 2016 14:01:09 -0800 (PST) Date: Tue, 1 Mar 2016 14:01:09 -0800 From: "Paul E. McKenney" To: Peter Zijlstra Cc: linux-kernel@vger.kernel.org, Andrew Morton , rjw@rjwysocki.net, konrad.wilk@oracle.com, Ingo Molnar , tj@kernel.org, davem@davemloft.net, linux-acpi@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [RFC][PATCH] tags: Fix DEFINE_PER_CPU expansions Message-ID: <20160301220109.GS3577@linux.vnet.ibm.com> Reply-To: paulmck@linux.vnet.ibm.com References: <20160301102625.GQ6357@twins.programming.kicks-ass.net> <20160301165650.GN3577@linux.vnet.ibm.com> <20160301213444.GZ6357@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20160301213444.GZ6357@twins.programming.kicks-ass.net> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16030122-0005-0000-0000-00001CEDA216 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Tue, Mar 01, 2016 at 10:34:44PM +0100, Peter Zijlstra wrote: > On Tue, Mar 01, 2016 at 08:56:50AM -0800, Paul E. McKenney wrote: > > +++ b/kernel/rcu/rcutorture.c > > @@ -131,9 +131,9 @@ static unsigned long rcu_torture_current_version; > > static struct rcu_torture rcu_tortures[10 * RCU_TORTURE_PIPE_LEN]; > > static DEFINE_SPINLOCK(rcu_torture_lock); > > static DEFINE_PER_CPU(long [RCU_TORTURE_PIPE_LEN + 1], > > - rcu_torture_count) = { 0 }; > > + rcu_torture_count); > > So the problem I was fixing is that the ctags regex needs the second > argument for the DEFINE_PER_CPU() macro on the same line. > > So it would still need to be: > > static DEFINE_PER_CPU(long [RCU_TORTURE_PIPE_LEN + 1], rcu_torture_count); > > > static DEFINE_PER_CPU(long [RCU_TORTURE_PIPE_LEN + 1], > > - rcu_torture_batch) = { 0 }; > > + rcu_torture_batch); > > static atomic_t rcu_torture_wcount[RCU_TORTURE_PIPE_LEN + 1]; > > static atomic_t n_rcu_torture_alloc; > > static atomic_t n_rcu_torture_alloc_fail; Ah, like this, then. Thanx, Paul ------------------------------------------------------------------------ commit 55d4929acdc66f00f27d79bfe273eeda01ec899f Author: Paul E. McKenney Date: Tue Mar 1 08:52:19 2016 -0800 rcutorture: Remove redundant initialization to zero The current code initializes the global per-CPU variables rcu_torture_count and rcu_torture_batch to zero. However, C does this initialization by default, and explicit initialization of per-CPU variables now needs a different syntax if "make tags" is to work. This commit therefore removes the initialization. Reported-by: Peter Zijlstra Signed-off-by: Paul E. McKenney --- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c index 1c2dc23ae07d..e75557368c04 100644 --- a/kernel/rcu/rcutorture.c +++ b/kernel/rcu/rcutorture.c @@ -130,10 +130,8 @@ static struct rcu_torture __rcu *rcu_torture_current; static unsigned long rcu_torture_current_version; static struct rcu_torture rcu_tortures[10 * RCU_TORTURE_PIPE_LEN]; static DEFINE_SPINLOCK(rcu_torture_lock); -static DEFINE_PER_CPU(long [RCU_TORTURE_PIPE_LEN + 1], - rcu_torture_count) = { 0 }; -static DEFINE_PER_CPU(long [RCU_TORTURE_PIPE_LEN + 1], - rcu_torture_batch) = { 0 }; +static DEFINE_PER_CPU(long [RCU_TORTURE_PIPE_LEN + 1], rcu_torture_count); +static DEFINE_PER_CPU(long [RCU_TORTURE_PIPE_LEN + 1], rcu_torture_batch); static atomic_t rcu_torture_wcount[RCU_TORTURE_PIPE_LEN + 1]; static atomic_t n_rcu_torture_alloc; static atomic_t n_rcu_torture_alloc_fail;