Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2993563AbdDYV1r (ORCPT ); Tue, 25 Apr 2017 17:27:47 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:46164 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1954734AbdDYV1d (ORCPT ); Tue, 25 Apr 2017 17:27:33 -0400 Date: Tue, 25 Apr 2017 14:27:27 -0700 From: "Paul E. McKenney" To: Steven Rostedt Cc: linux-kernel@vger.kernel.org, mingo@kernel.org, jiangshanlai@gmail.com, dipankar@in.ibm.com, akpm@linux-foundation.org, mathieu.desnoyers@efficios.com, josh@joshtriplett.org, tglx@linutronix.de, peterz@infradead.org, dhowells@redhat.com, edumazet@google.com, fweisbec@gmail.com, oleg@redhat.com, bobby.prani@gmail.com Subject: Re: [PATCH v3 tip/core/rcu 05/40] rcu: Semicolon inside RCU_TRACE() for rcu.h Reply-To: paulmck@linux.vnet.ibm.com References: <20170419165805.GB10874@linux.vnet.ibm.com> <1492621117-13939-5-git-send-email-paulmck@linux.vnet.ibm.com> <20170425171350.7d7bf17c@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170425171350.7d7bf17c@gandalf.local.home> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 17042521-2213-0000-0000-000001A08FAC X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00006973; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000208; SDB=6.00852418; UDB=6.00421347; IPR=6.00631256; BA=6.00005312; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00015175; XFM=3.00000013; UTC=2017-04-25 21:27:31 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17042521-2214-0000-0000-000055C73397 Message-Id: <20170425212727.GH3956@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-04-25_15:,, 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-1703280000 definitions=main-1704250368 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2014 Lines: 52 On Tue, Apr 25, 2017 at 05:13:50PM -0400, Steven Rostedt wrote: > On Wed, 19 Apr 2017 09:58:02 -0700 > "Paul E. McKenney" wrote: > > > The current use of "RCU_TRACE(statement);" can cause odd bugs, especially > > where "statement" is a local-variable declaration, as it can leave a > > misplaced ";" in the source code. This commit therefore converts these > > to "RCU_TRACE(statement;)", which avoids the misplaced ";". > > > > Reported-by: Josh Triplett > > Signed-off-by: Paul E. McKenney > > --- > > kernel/rcu/rcu.h | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/kernel/rcu/rcu.h b/kernel/rcu/rcu.h > > index 0d6ff3e471be..8700a81daf56 100644 > > --- a/kernel/rcu/rcu.h > > +++ b/kernel/rcu/rcu.h > > @@ -109,12 +109,12 @@ static inline bool __rcu_reclaim(const char *rn, struct rcu_head *head) > > > > rcu_lock_acquire(&rcu_callback_map); > > if (__is_kfree_rcu_offset(offset)) { > > - RCU_TRACE(trace_rcu_invoke_kfree_callback(rn, head, offset)); > > + RCU_TRACE(trace_rcu_invoke_kfree_callback(rn, head, offset);) > > I have to ask. Why is this a RCU_TRACE() anyway? tracepoints use jump > labels, and this is basically a nop here when tracing is off. Because otherwise the build breaks if CONFIG_RCU_TRACE=n. So it is not the tracepoints themselves, but their helper functions. Worse, the variables declared for them. Even worse, in Tiny RCU, the fields in structures that are used only for tracing. I freely admit that there might be a better way to structure this, give or take the Tiny RCU structure fields. Thanx, Paul > -- Steve > > > > kfree((void *)head - offset); > > rcu_lock_release(&rcu_callback_map); > > return true; > > } else { > > - RCU_TRACE(trace_rcu_invoke_callback(rn, head)); > > + RCU_TRACE(trace_rcu_invoke_callback(rn, head);) > > head->func(head); > > rcu_lock_release(&rcu_callback_map); > > return false; >