lkml.org 
[lkml]   [2017]   [Jan]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH tip/core/rcu 1/6] rcu: Abstract the dynticks momentary-idle operation
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 <paulmck@linux.vnet.ibm.com>
> >
> > 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 <josh@joshtriplett.org>


\
 
 \ /
  Last update: 2017-01-16 19:58    [W:0.061 / U:0.248 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site