From: Peter Zijlstra <peterz@infradead.org>
To: Boqun Feng <boqun.feng@gmail.com>
Cc: Davidlohr Bueso <dave@stgolabs.net>,
Pan Xinhui <xinhui.pan@linux.vnet.ibm.com>,
linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org,
arnd@arndb.de, waiman.long@hp.com
Subject: Re: [PATCH] locking/qspinlock: Use atomic_sub_return_release in queued_spin_unlock
Date: Tue, 14 Jun 2016 14:04:46 +0200 [thread overview]
Message-ID: <20160614120446.GG30154@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <20160614055253.GA20090@insomnia>
On Tue, Jun 14, 2016 at 01:52:53PM +0800, Boqun Feng wrote:
> On Mon, Jun 13, 2016 at 12:45:23PM -0700, Davidlohr Bueso wrote:
> > On Fri, 03 Jun 2016, Pan Xinhui wrote:
> >
> > > The existing version uses a heavy barrier while only release semantics
> > > is required. So use atomic_sub_return_release instead.
> > >
> > > Suggested-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> > > Signed-off-by: Pan Xinhui <xinhui.pan@linux.vnet.ibm.com>
> >
> > I just noticed this change in -tip and, while I know that saving a barrier
> > in core spinlock paths is perhaps a worthy exception, I cannot help but
> > wonder if this is the begging of the end for smp__{before,after}_atomic().
>
> This is surely a good direction I think, that is using _acquire and
> _release primitives to replace those barriers. However, I think we
> should do this carefully, because the _acquire and _release primitives
> are RCpc because they are on PPC, IOW, a ACQUIRE and RELEASE pair is not
> a full barrier nor provides global transivity. I'm worried about there
> are some users depending on the full-barrier semantics, which means we
> must audit each use carefully before we make the change.
Very good point indeed. And yes, the whole RCpc thing, but also the
tricky wandering store on PPC/ARM64 ACQUIRE makes for lots of 'fun' we
can do without.
> Besides, if we want to do the conversion, we'd better have _acquire and
> _release variants for non-value-returning atomic operations.
Indeed, I've been tempted to introduce those before.
> I remember you were working on those variants. How is that going?
Ah, if Davidlohr is working on that, brilliant, less work for me ;-)
prev parent reply other threads:[~2016-06-14 12:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-03 8:38 [PATCH] locking/qspinlock: Use atomic_sub_return_release in queued_spin_unlock Pan Xinhui
2016-06-08 14:27 ` [tip:locking/core] locking/qspinlock: Use atomic_sub_return_release() in queued_spin_unlock() tip-bot for Pan Xinhui
2016-06-13 19:45 ` [PATCH] locking/qspinlock: Use atomic_sub_return_release in queued_spin_unlock Davidlohr Bueso
2016-06-14 5:52 ` Boqun Feng
2016-06-14 12:04 ` Peter Zijlstra [this message]
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=20160614120446.GG30154@twins.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=arnd@arndb.de \
--cc=boqun.feng@gmail.com \
--cc=dave@stgolabs.net \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=waiman.long@hp.com \
--cc=xinhui.pan@linux.vnet.ibm.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox