mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Pranith Kumar <bobby.prani@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	"maintainer:X86 ARCHITECTURE..." <x86@kernel.org>,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
	"open list:X86 ARCHITECTURE..." <linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH] x86: Use volatile semantics for atomic_set()
Date: Tue, 23 Sep 2014 10:12:46 +0200	[thread overview]
Message-ID: <20140923081246.GB3312@worktop.programming.kicks-ass.net> (raw)
In-Reply-To: <CAJhHMCC7RKE9GE3fGx0pnNoZHL0r_MOPMPwCjjNNbnC6i0G=BA@mail.gmail.com>

On Mon, Sep 22, 2014 at 05:42:16PM -0400, Pranith Kumar wrote:
> On Mon, Sep 22, 2014 at 4:08 PM, Peter Zijlstra <peterz@infradead.org> wrote:
> > On Mon, Sep 22, 2014 at 03:39:21PM -0400, Pranith Kumar wrote:
> >> All the atomic operations have volatile semantics to prevent compiler
> >> reordering. Enforce the same semantics for atomic_set() too.
> >
> > To what point? atomic_set() is typically not what you expect it to
> > anyhow.
> 
> This is the only atomic operation which allows compiler reordering. I
> am not sure why this exception was made. Any ideas as to why we do
> this?

Because it typically doesn't matter. And you should never use
atomic_set() where it does matter.

      reply	other threads:[~2014-09-23  8:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-22 19:39 Pranith Kumar
2014-09-22 20:08 ` Peter Zijlstra
2014-09-22 21:42   ` Pranith Kumar
2014-09-23  8:12     ` 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=20140923081246.GB3312@worktop.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=bobby.prani@gmail.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.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

Powered by JetHome