From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751012AbdAPS5S (ORCPT ); Mon, 16 Jan 2017 13:57:18 -0500 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:46784 "EHLO relay2-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750777AbdAPS5R (ORCPT ); Mon, 16 Jan 2017 13:57:17 -0500 X-Originating-IP: 50.39.169.170 Date: Mon, 16 Jan 2017 10:57:04 -0800 From: Josh Triplett To: "Paul E. McKenney" 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 1/6] rcu: Abstract the dynticks momentary-idle operation Message-ID: <20170116185704.2cpgih6idiegn7k3@x> References: <20170114085406.GA19052@linux.vnet.ibm.com> <1484384085-19444-1-git-send-email-paulmck@linux.vnet.ibm.com> <20170116073951.ipupoxcjnv42dwop@x> <20170116112239.GL5238@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170116112239.GL5238@linux.vnet.ibm.com> User-Agent: NeoMutt/20161126 (1.7.1) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 16, 2017 at 03:22:39AM -0800, Paul E. McKenney wrote: > On Sun, Jan 15, 2017 at 11:39:51PM -0800, Josh Triplett wrote: > > On Sat, Jan 14, 2017 at 12:54:40AM -0800, Paul E. McKenney wrote: > > > This commit is the first step towards full abstraction of all accesses to > > > the ->dynticks counter, implementing the previously open-coded atomic add > > > of two in a new rcu_dynticks_momentary_idle() function. This abstraction > > > will ease changes to the ->dynticks counter operation. > > > > > > Signed-off-by: Paul E. McKenney > > > > This change has an additional effect not documented in the commit > > message: it eliminates the smp_mb__before_atomic and > > smp_mb__after_atomic calls. Can you please document that in the commit > > message, and explain why that doesn't cause a problem? > > The trick is that the old code used the non-value-returning atomic_add(), > which does not imply ordering, hence the smp_mb__before_atomic() and > smp_mb__after_atomic() calls. The new code uses atomic_add_return(), > which does return a value, and therefore implies full ordering in and > of itself. > > How would you like me to proceed? With the above explanation added to the commit message: Reviewed-by: Josh Triplett