[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20141112101052.GI29390@twins.programming.kicks-ass.net>
Date: Wed, 12 Nov 2014 11:10:52 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Alexander Duyck <alexander.h.duyck@...hat.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
alexander.duyck@...il.com,
"linux-arch@...r.kernel.org" <linux-arch@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Michael Neuling <mikey@...ling.org>,
Tony Luck <tony.luck@...el.com>,
Mathieu Desnoyers <mathieu.desnoyers@...ymtl.ca>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Heiko Carstens <heiko.carstens@...ibm.com>,
Oleg Nesterov <oleg@...hat.com>,
Will Deacon <will.deacon@....com>,
Michael Ellerman <michael@...erman.id.au>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
Frederic Weisbecker <fweisbec@...il.com>,
Martin Schwidefsky <schwidefsky@...ibm.com>,
Russell King <linux@....linux.org.uk>,
"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
Ingo Molnar <mingo@...nel.org>
Subject: Re: [PATCH] arch: Introduce read_acquire()
On Tue, Nov 11, 2014 at 12:45:23PM -0800, Alexander Duyck wrote:
>
> On 11/11/2014 11:40 AM, Linus Torvalds wrote:
> >On Tue, Nov 11, 2014 at 10:57 AM, <alexander.duyck@...il.com> wrote:
> >>
> >>
> >>On reviewing the documentation and code for smp_load_acquire() it occurred
> >>to me that implementing something similar for CPU <-> device interaction
> >>would be worth while. This commit provides just the load/read side of this
> >>in the form of read_acquire().
> >
> >So I don't hate the concept, but. there's a couple of reasons to think
> >this is broken.
> >
> >One is just the name. Why do we have "smp_load_acquire()", but then
> >call the non-smp version "read_acquire()"? That makes very little
> >sense to me. Why did "load" become "read"?
>
> The idea behind read vs load in the name was because smp_load_acquire is
> using a full smp_mb() whereas this just falls back to rmb() for the cases it
> is dealing with. My main conern is that a full memory barrier would be more
> expensive so I didn't want to give the idea that this is as completed as
> smp_load_acquire(). The read_acquire() call is not strictly enforcing any
> limitations on writes/stores, although there are a few cases where the
> barriers used do leak that functionality over as a side-effect.
Then I object. We should not name it acquire if it does not in fact
provides acquire semantics.
Memory ordering is hard enough, we don't need random weird semantics
mixed in just because.
--
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