From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Boqun Feng <boqun.feng@gmail.com>,
Waiman Long <longman@redhat.com>, Ingo Molnar <mingo@redhat.com>,
linux-kernel@vger.kernel.org,
Pan Xinhui <xinhui@linux.vnet.ibm.com>,
Andrea Parri <parri.andrea@gmail.com>,
Will Deacon <will.deacon@arm.com>
Subject: Re: [RESEND PATCH v5] locking/pvqspinlock: Relax cmpxchg's to improve performance on some archs
Date: Thu, 10 Aug 2017 13:49:34 -0700 [thread overview]
Message-ID: <20170810204934.GS3730@linux.vnet.ibm.com> (raw)
In-Reply-To: <20170810091317.hv6smfz5fxgolu2n@hirez.programming.kicks-ass.net>
On Thu, Aug 10, 2017 at 11:13:17AM +0200, Peter Zijlstra wrote:
> On Thu, Aug 10, 2017 at 04:12:13PM +0800, Boqun Feng wrote:
>
> > > Or is the reason this doesn't work on PPC that its RCpc?
>
> So that :-)
>
> > Here is an example why PPC needs a sync() before the cmpxchg():
> >
> > https://marc.info/?l=linux-kernel&m=144485396224519&w=2
> >
> > and Paul Mckenney's detailed explanation about why this could happen:
> >
> > https://marc.info/?l=linux-kernel&m=144485909826241&w=2
> >
> > (Somehow, I feel like he was answering to a similar question question as
> > you ask here ;-))
>
> Yes, and I had vague memories of having gone over this before, but
> couldn't quickly find things. Thanks!
>
> > And I think aarch64 doesn't have a problem here because it is "(other)
> > multi-copy atomic". Will?
>
> Right, its the RCpc vs RCsc thing. The ARM64 release is as you say
> multi-copy atomic, whereas the PPC lwsync is not.
>
> This still leaves us with the situation that we need an smp_mb() between
> smp_store_release() and a possibly failing cmpxchg() if we want to
> guarantee the cmpxchg()'s load comes after the store-release.
For whatever it is worth, this is why C11 allows specifying one
memory-order strength for the success case and another for the failure
case. But it is not immediately clear that we need another level
of combinatorial API explosion...
Thanx, Paul
next prev parent reply other threads:[~2017-08-10 20:49 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-24 13:38 [RESEND PATCH v5] locking/pvqspinlock: Relax cmpxchg's to improve performance on some archs Waiman Long
2017-08-09 13:39 ` Waiman Long
2017-08-09 15:06 ` Peter Zijlstra
2017-08-09 15:15 ` Peter Zijlstra
2017-08-10 8:12 ` Boqun Feng
2017-08-10 9:13 ` Peter Zijlstra
2017-08-10 20:49 ` Paul E. McKenney [this message]
2017-08-10 11:50 ` Peter Zijlstra
2017-08-10 13:27 ` Waiman Long
2017-08-10 13:58 ` Waiman Long
2017-08-10 16:15 ` Peter Zijlstra
2017-08-10 16:22 ` Waiman Long
2017-08-10 18:18 ` Waiman Long
2017-08-11 9:06 ` Peter Zijlstra
2017-08-14 12:01 ` Will Deacon
2017-08-14 15:01 ` Waiman Long
2017-08-14 16:02 ` Will Deacon
2017-08-14 18:47 ` Peter Zijlstra
2017-08-15 18:40 ` Will Deacon
2017-08-21 10:55 ` Peter Zijlstra
2017-08-21 18:00 ` Will Deacon
2017-08-21 19:25 ` Peter Zijlstra
2017-08-21 19:42 ` Peter Zijlstra
2017-08-22 15:35 ` Waiman Long
2017-08-22 10:40 ` Will Deacon
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=20170810204934.GS3730@linux.vnet.ibm.com \
--to=paulmck@linux.vnet.ibm.com \
--cc=boqun.feng@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=longman@redhat.com \
--cc=mingo@redhat.com \
--cc=parri.andrea@gmail.com \
--cc=peterz@infradead.org \
--cc=will.deacon@arm.com \
--cc=xinhui@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