From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750944AbdAQAMo (ORCPT ); Mon, 16 Jan 2017 19:12:44 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:37964 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750916AbdAQAMn (ORCPT ); Mon, 16 Jan 2017 19:12:43 -0500 Date: Mon, 16 Jan 2017 16:12:37 -0800 From: "Paul E. McKenney" To: Josh Triplett Cc: linux-kernel@vger.kernel.org, mingo@kernel.org, jiangshanlai@gmail.com, dipankar@in.ibm.com, akpm@linux-foundation.org, mathieu.desnoyers@efficios.com, tglx@linutronix.de, peterz@infradead.org, rostedt@goodmis.org, dhowells@redhat.com, edumazet@google.com, dvhart@linux.intel.com, fweisbec@gmail.com, oleg@redhat.com, bobby.prani@gmail.com Subject: Re: [PATCH tip/core/rcu 3/6] rcu: Abstract dynticks extended quiescent state enter/exit operations Reply-To: paulmck@linux.vnet.ibm.com References: <20170114085406.GA19052@linux.vnet.ibm.com> <1484384085-19444-3-git-send-email-paulmck@linux.vnet.ibm.com> <20170116074734.jt6iddgnhb7oo3pv@x> <20170116113420.GM5238@linux.vnet.ibm.com> <20170116192537.etuzs7lvo2h7il6g@x> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170116192537.etuzs7lvo2h7il6g@x> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17011700-0020-0000-0000-00000B174150 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00006446; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000199; SDB=6.00808587; UDB=6.00393814; IPR=6.00585946; BA=6.00005062; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00013943; XFM=3.00000011; UTC=2017-01-17 00:12:41 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17011700-0021-0000-0000-000059428AD8 Message-Id: <20170117001237.GU5238@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-01-16_18:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1612050000 definitions=main-1701170000 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 16, 2017 at 11:25:38AM -0800, Josh Triplett wrote: > On Mon, Jan 16, 2017 at 03:34:20AM -0800, Paul E. McKenney wrote: > > On Sun, Jan 15, 2017 at 11:47:35PM -0800, Josh Triplett wrote: > > > On Sat, Jan 14, 2017 at 12:54:42AM -0800, Paul E. McKenney wrote: [ . . . ] > > > > @@ -693,7 +752,7 @@ static void rcu_eqs_enter_common(long long oldval, bool user) > > > > { > > > > struct rcu_state *rsp; > > > > struct rcu_data *rdp; > > > > - struct rcu_dynticks *rdtp = this_cpu_ptr(&rcu_dynticks); > > > > + struct rcu_dynticks __maybe_unused *rdtp = this_cpu_ptr(&rcu_dynticks); > > > > > > Rather than marking a local variable as __maybe_unused (such that the > > > compiler can no longer help detect it as unused), could you move it into > > > the portion of the function that uses it, so that if reached, it'll > > > always get used? > > > > > > > trace_rcu_dyntick(TPS("Start"), oldval, rdtp->dynticks_nesting); > > > > Its only use is in the above event trace, which can be disabled via > > CONFIG_RCU_TRACE=n. I could put the definition of rdtp under #ifdef, > > but this seems ugly. I could eliminate the variable, substituting > > the initialization for rdtp in the event trace, but that would make > > for a very long line, or an odd line break. > > For the trace_rcu_dyntick calls, you could create a small static inline > helper to do the tracing, eliminating the third argument. Or you could > create a helper that returns > this_cpu_ptr(&rcu_dynticks)->dynticks_nesting. Either way would work. > > Or, if you prefer, you could wrap the variable > declaration/initialization in RCU_TRACE() rather than adding > __maybe_unused. RCU_TRACE() it is in both cases, thank you! (You would think I would remember the code that I wrote...) Thanx, Paul