From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Davidlohr Bueso <dave@stgolabs.net>,
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Cc: Manfred Spraul <manfred@colorfullife.com>,
Michael Ellerman <mpe@ellerman.id.au>,
Andrew Morton <akpm@linux-foundation.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Susanne Spraul <1vier1@web.de>,
Peter Zijlstra <peterz@infradead.org>,
parri.andrea@gmail.com
Subject: Re: spin_lock implicit/explicit memory barrier
Date: Thu, 11 Aug 2016 09:59:58 +1000 [thread overview]
Message-ID: <1470873598.3015.118.camel@kernel.crashing.org> (raw)
In-Reply-To: <20160810222316.GA22336@linux-80c1.suse>
On Wed, 2016-08-10 at 15:23 -0700, Davidlohr Bueso wrote:
> On Wed, 10 Aug 2016, Paul E. McKenney wrote:
>
> >
> > On Wed, Aug 10, 2016 at 08:21:22PM +0200, Manfred Spraul wrote:
> 4)
> > > spin_unlock_wait() and spin_unlock() pair
> > > http://git.cmpxchg.org/cgit.cgi/linux-mmots.git/tree/ipc/sem.c#n291
> > > http://git.cmpxchg.org/cgit.cgi/linux-mmots.git/tree/ipc/sem.c#n409
> > > The data from the simple op must be observed by the following
> > > complex op. Right now, there is still an smp_rmb() in line 300: The
> > > control barrier from the loop inside spin_unlock_wait() is upgraded
> > > to an acquire barrier by an additional smp_rmb(). Is this smp_rmb()
> > > required? If I understand commit 2c6100227116 ("locking/qspinlock:
> > > Fix spin_unlock_wait() some more") right, with this commit qspinlock
> > > handle this case without the smp_rmb(). What I don't know if powerpc
> > > is using qspinlock already, or if powerpc works without the
> > > smp_rmb(). -- Manfred|
>
> > No, ppc doesn't use qspinlocks,
... yet. There are patches pending to add support for them
> but as mentioned, spin_unlock_wait for
> > tickets are now at least an acquire (ppc is stronger),
The unlock path for qspinlock for us will be a release.
> which match that
> unlock store-release you are concerned about, this is as of 726328d92a4
> (locking/spinlock, arch: Update and fix spin_unlock_wait() implementations).
>
> This is exactly what you are doing by upgrading the ctrl dependency to
> the acquire barrier in http://git.cmpxchg.org/cgit.cgi/linux-mmots.git/tree/ipc/sem.c#n291
> and therefore we don't need it explicitly -- it also makes the comment
> wrt spin_unlock_wait obsolete. Or am I'm misunderstanding you?
Ben.
next prev parent reply other threads:[~2016-08-11 0:00 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-09 18:52 spin_lock implicit/explicit memory barrier Manfred Spraul
2016-08-10 0:05 ` Benjamin Herrenschmidt
2016-08-10 18:21 ` Manfred Spraul
2016-08-10 19:17 ` Davidlohr Bueso
2016-08-10 21:00 ` Paul E. McKenney
2016-08-15 20:06 ` Manfred Spraul
2016-08-15 20:28 ` Paul E. McKenney
2016-08-12 2:47 ` Boqun Feng
2016-08-12 18:43 ` Manfred Spraul
2016-08-22 9:15 ` Boqun Feng
2016-08-10 20:52 ` Paul E. McKenney
2016-08-10 22:23 ` Davidlohr Bueso
2016-08-10 22:58 ` Paul E. McKenney
2016-08-10 23:29 ` Davidlohr Bueso
2016-08-11 8:11 ` Peter Zijlstra
2016-08-11 18:31 ` Davidlohr Bueso
2016-08-12 2:59 ` Boqun Feng
2016-08-19 14:01 ` Peter Zijlstra
2016-08-10 23:59 ` Benjamin Herrenschmidt [this message]
2016-08-10 18:33 ` Paul E. McKenney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1470873598.3015.118.camel@kernel.crashing.org \
--to=benh@kernel.crashing.org \
--cc=1vier1@web.de \
--cc=akpm@linux-foundation.org \
--cc=dave@stgolabs.net \
--cc=linux-kernel@vger.kernel.org \
--cc=manfred@colorfullife.com \
--cc=mpe@ellerman.id.au \
--cc=parri.andrea@gmail.com \
--cc=paulmck@linux.vnet.ibm.com \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.