Re: [PATCH] Documentation: atomic_t.txt: Explain ordering provided by smp_mb__{before,after}_atomic()

From: Johan Hovold
Date: Mon Apr 29 2019 - 05:24:35 EST


On Tue, Apr 23, 2019 at 06:30:10AM -0700, Paul E. McKenney wrote:
> On Tue, Apr 23, 2019 at 02:32:09PM +0200, Peter Zijlstra wrote:
> > On Sat, Apr 20, 2019 at 01:54:40AM -0700, Paul E. McKenney wrote:

> > > And lock acquisition??? acm_read_bulk_callback().
> >
> > I think it goes with the set_bit() earlier, but what do I know.
>
> Quite possibly! In that case it should be smp_mb__after_atomic(),
> and it would be nice if it immediately followed the set_bit().

I noticed this one last week as well. The set_bit() had been incorrectly
moved and without noticing the smp_mb__before_atomic(). I've submitted a
patch to restore it and to fix a related issue to due missing barriers:

https://lkml.kernel.org/r/20190425160540.10036-5-johan@xxxxxxxxxx

Johan