Re: [v3,11/41] mips: reuse asm-generic/barrier.h
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: Paul McKenney <paulmck@xxxxxxxxxxxxxxxxxx>
- Subject: Re: [v3,11/41] mips: reuse asm-generic/barrier.h
- From: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 26 Jan 2016 14:15:21 -0800
- Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>, Boqun Feng <boqun.feng@xxxxxxxxx>, Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>, Leonid Yegoshin <Leonid.Yegoshin@xxxxxxxxxx>, linux-mips <linux-mips@xxxxxxxxxxxxxx>, "linux-ia64@xxxxxxxxxxxxxxx" <linux-ia64@xxxxxxxxxxxxxxx>, "Michael S. Tsirkin" <mst@xxxxxxxxxx>, 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>, uml-devel <user-mode-linux-devel@xxxxxxxxxxxxxxxxxxxxx>, 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>, Arnd Bergmann <arnd@xxxxxxxx>, Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>, adi-buildroot-devel@xxxxxxxxxxxxxxxxxxxxx, 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>, Joe Perches <joe@xxxxxxxxxxx>, ppc-dev <linuxppc-dev@xxxxxxxxxxxxxxxx>, David Miller <davem@xxxxxxxxxxxxx>
- In-reply-to: <20160126201037.GU4503@linux.vnet.ibm.com>
- List-id: <linux-ia64.vger.kernel.org>
- References: <20160114204827.GE3818@linux.vnet.ibm.com> <20160118081929.GA30420@gondor.apana.org.au> <20160118154629.GB3818@linux.vnet.ibm.com> <20160126165207.GB6029@fixme-laptop.cn.ibm.com> <20160126172227.GG6357@twins.programming.kicks-ass.net> <CA+55aFzcC6C8imPs5vk4yH1Y2YHjnAdFM9HCkVs04COxuDQH6w@mail.gmail.com> <20160126201037.GU4503@linux.vnet.ibm.com>
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
--
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]