public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Boqun Feng <boqun.feng@gmail.com>
To: Davidlohr Bueso <dave@stgolabs.net>
Cc: Pan Xinhui <xinhui.pan@linux.vnet.ibm.com>,
	linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org,
	arnd@arndb.de, peterz@infradead.org, waiman.long@hp.com
Subject: Re: [PATCH] locking/qspinlock: Use atomic_sub_return_release in queued_spin_unlock
Date: Tue, 14 Jun 2016 13:52:53 +0800	[thread overview]
Message-ID: <20160614055253.GA20090@insomnia> (raw)
In-Reply-To: <20160613194523.GA2094@linux-80c1.suse>

[-- Attachment #1: Type: text/plain, Size: 1329 bytes --]

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.

Besides, if we want to do the conversion, we'd better have _acquire and
_release variants for non-value-returning atomic operations.

I remember you were working on those variants. How is that going?

Regards,
Boqun

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

  reply	other threads:[~2016-06-14  5:49 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 [this message]
2016-06-14 12:04     ` Peter Zijlstra

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=20160614055253.GA20090@insomnia \
    --to=boqun.feng@gmail.com \
    --cc=arnd@arndb.de \
    --cc=dave@stgolabs.net \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.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