linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Will Deacon <will.deacon@arm.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Tony Luck <tony.luck@intel.com>,
	"linux-arch@vger.kernel.org" <linux-arch@vger.kernel.org>,
	Arnd Bergmann <arnd@arndb.de>
Subject: Re: [RFC PATCH 1/4] asm-generic: cmpxchg: implement dummy cmpxchg64_relaxed operation
Date: Thu, 26 Sep 2013 16:53:31 +0100	[thread overview]
Message-ID: <20130926155330.GC4175@mudshark.cambridge.arm.com> (raw)
In-Reply-To: <CA+55aFzCiOxpgdJagSVdsBYEU66zBSBXZpnU5-jvQpAX6T7SiA@mail.gmail.com>

On Thu, Sep 26, 2013 at 04:34:04PM +0100, Linus Torvalds wrote:
> On Thu, Sep 26, 2013 at 8:13 AM, Will Deacon <will.deacon@arm.com> wrote:
> >
> > This patch implements a dummy implementation for asm-generic, falling
> > back to the usual cmpxchg64 code.
> 
> I don't like the "let's add dummy operations for everybody who doesn't
> care" when it is this specialized.
> 
> I'd much rather just add a single
> 
>    #ifndef cmpxchg64_relaxed
>    # define cmpxchg64_relaxed cmpxchg64
>    #endif
> 
> to the LOCKREF code, and then ARM (and others) can define it as they wish.

Okey doke.

> And *if* anybody else ever realizes that they want this outside of the
> lockref code, let's look at doing that then. Right now I don't know of
> any users, and I'd be leery of people using this willy-nilly, because
> very few people really understand memory ordering.

Agreed, and I really doubt there are many cases where the cmpxchg hazarding
works out nicely so as to obviate the need for memory barriers.

I'll send a revised patch.

Cheers,

Will

      parent reply	other threads:[~2013-09-26 15:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-26 15:13 [RFC PATCH 1/4] asm-generic: cmpxchg: implement dummy cmpxchg64_relaxed operation Will Deacon
2013-09-26 15:13 ` Will Deacon
2013-09-26 15:13 ` [RFC PATCH 2/4] x86: " Will Deacon
2013-09-26 15:13 ` [RFC PATCH 3/4] ia64: " Will Deacon
2013-09-26 15:13 ` [RFC PATCH 4/4] lib: lockref: use relaxed cmpxchg64 variant for lockless updates Will Deacon
2013-09-26 15:13   ` Will Deacon
2013-09-26 15:34 ` [RFC PATCH 1/4] asm-generic: cmpxchg: implement dummy cmpxchg64_relaxed operation Linus Torvalds
2013-09-26 15:34   ` Linus Torvalds
2013-09-26 15:53   ` Will Deacon [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=20130926155330.GC4175@mudshark.cambridge.arm.com \
    --to=will.deacon@arm.com \
    --cc=arnd@arndb.de \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tony.luck@intel.com \
    --cc=torvalds@linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).