[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Xen-devel] [v3,11/41] mips: reuse asm-generic/barrier.h
- To: Paul McKenney <paulmck@xxxxxxxxxxxxxxxxxx>
- From: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 26 Jan 2016 14:15:21 -0800
- Cc: linux-mips <linux-mips@xxxxxxxxxxxxxx>, "linux-ia64@xxxxxxxxxxxxxxx" <linux-ia64@xxxxxxxxxxxxxxx>, "Michael S. Tsirkin" <mst@xxxxxxxxxx>, Peter Zijlstra <peterz@xxxxxxxxxxxxx>, Will Deacon <will.deacon@xxxxxxx>, virtualization <virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx>, Peter Anvin <hpa@xxxxxxxxx>, sparclinux@xxxxxxxxxxxxxxx, Ingo Molnar <mingo@xxxxxxxxxx>, "linux-arch@xxxxxxxxxxxxxxx" <linux-arch@xxxxxxxxxxxxxxx>, linux-s390 <linux-s390@xxxxxxxxxxxxxxx>, Russell King - ARM Linux <linux@xxxxxxxxxxxxxxxx>, Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>, linux-sh@xxxxxxxxxxxxxxx, Michael Ellerman <mpe@xxxxxxxxxxxxxx>, the arch/x86 maintainers <x86@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, Ingo Molnar <mingo@xxxxxxx>, linux-xtensa@xxxxxxxxxxxxxxxx, James Hogan <james.hogan@xxxxxxxxxx>, uml-devel <user-mode-linux-devel@xxxxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>, Boqun Feng <boqun.feng@xxxxxxxxx>, adi-buildroot-devel@xxxxxxxxxxxxxxxxxxxxx, Leonid Yegoshin <Leonid.Yegoshin@xxxxxxxxxx>, David Daney <ddaney.cavm@xxxxxxxxx>, Thomas Gleixner <tglx@xxxxxxxxxxxxx>, linux-metag@xxxxxxxxxxxxxxx, "linux-arm-kernel@xxxxxxxxxxxxxxxxxxx" <linux-arm-kernel@xxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Linux Kernel Mailing List <linux-kernel@xxxxxxxxxxxxxxx>, Ralf Baechle <ralf@xxxxxxxxxxxxxx>, Arnd Bergmann <arnd@xxxxxxxx>, Joe Perches <joe@xxxxxxxxxxx>, ppc-dev <linuxppc-dev@xxxxxxxxxxxxxxxx>, David Miller <davem@xxxxxxxxxxxxx>
- Delivery-date: Tue, 26 Jan 2016 22:15:48 +0000
- List-id: Xen developer discussion <xen-devel.lists.xen.org>
On Tue, Jan 26, 2016 at 12:10 PM, Paul E. McKenney
<paulmck@xxxxxxxxxxxxxxxxxx> wrote:
> On Tue, Jan 26, 2016 at 11:44:46AM -0800, Linus Torvalds wrote:
>>
>> > struct foo *x = READ_ONCE(*ptr);
>> > smp_read_barrier_depends();
>> > x->bar = 5;
>>
>> This case is complete BS. Stop perpetuating it. I already removed a
>> number of bogus cases of it, and I removed the incorrect documentation
>> that had this crap.
>
> If I understand your objection correctly, you want the above pattern
> expressed either like this:
>
> struct foo *x = rcu_dereference(*ptr);
> x->bar = 5;
>
> Or like this:
>
> struct foo *x = lockless_dereference(*ptr);
> x->bar = 5;
>
> Or am I missing your point?
You are entirely missing the point.
You might as well just write it as
struct foo x = READ_ONCE(*ptr);
x->bar = 5;
because that "smp_read_barrier_depends()" does NOTHING wrt the second write.
So what I am saying is simple: anybody who writes that
"smp_read_barrier_depends()" in there is just ttoally and completely
WRONG, and the fact that Peter wrote it out after I removed several
instances of that bloody f*cking idiocy is disturbing.
Don't do it. It's BS. It's wrong. Don't make excuses for it.
Linus
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|