From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751541AbdAPVBf (ORCPT ); Mon, 16 Jan 2017 16:01:35 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:38411 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750917AbdAPVBc (ORCPT ); Mon, 16 Jan 2017 16:01:32 -0500 Date: Mon, 16 Jan 2017 13:01:11 -0800 From: "Paul E. McKenney" To: Peter Zijlstra 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, 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> <20170116164337.GB6500@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170116164337.GB6500@twins.programming.kicks-ass.net> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17011621-0004-0000-0000-0000114CE62B X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00006445; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000199; SDB=6.00808524; UDB=6.00393776; IPR=6.00585883; 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.00013940; XFM=3.00000011; UTC=2017-01-16 21:01:15 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17011621-0005-0000-0000-00007C36CDDC Message-Id: <20170116210111.GP5238@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-01-16_17:,, 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-1701160294 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 16, 2017 at 05:43:37PM +0100, Peter Zijlstra wrote: > On Sat, Jan 14, 2017 at 12:54:42AM -0800, Paul E. McKenney wrote: > > /* > > + * Record entry into an extended quiescent state. This is only to be > > + * called when not already in an extended quiescent state. > > + */ > > +static void rcu_dynticks_eqs_enter(void) > > +{ > > + struct rcu_dynticks *rdtp = this_cpu_ptr(&rcu_dynticks); > > + > > + /* > > + * CPUs seeing atomic_inc() must see prior RCU read-side critical > > + * sections, and we also must force ordering with the next idle > > + * sojourn. > > + */ > > + smp_mb__before_atomic(); /* See above. */ > > + atomic_inc(&rdtp->dynticks); > > + smp_mb__after_atomic(); /* See above. */ > > + WARN_ON_ONCE(IS_ENABLED(CONFIG_RCU_EQS_DEBUG) && > > + atomic_read(&rdtp->dynticks) & 0x1); > > +} > > In an earlier patch you replaced things with atomic_add_return(), why > not use atomic_inc_return() here? The rationale is that the earlier patch uses the return value unconditionally, while at this site, the return value would be used only if CONFIG_RCU_EQS_DEBUG. But mostly inertia. Thanx, Paul