[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20140923081246.GB3312@worktop.programming.kicks-ass.net>
Date: Tue, 23 Sep 2014 10:12:46 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Pranith Kumar <bobby.prani@...il.com>
Cc: Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>,
"maintainer:X86 ARCHITECTURE..." <x86@...nel.org>,
"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
"open list:X86 ARCHITECTURE..." <linux-kernel@...r.kernel.org>
Subject: Re: [RFC PATCH] x86: Use volatile semantics for atomic_set()
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@...radead.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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists