[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20150326171219.GI28980@linux.vnet.ibm.com>
Date: Thu, 26 Mar 2015 10:12:19 -0700
From: "Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Peter Zijlstra <peterz@...radead.org>,
Christian Borntraeger <borntraeger@...ibm.com>,
Thomas Gleixner <tglx@...utronix.de>,
"linux-next@...r.kernel.org" <linux-next@...r.kernel.org>,
Stephen Rothwell <sfr@...b.auug.org.au>,
Ingo Molnar <mingo@...e.hu>,
Davidlohr Bueso <dave@...olabs.net>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"H. Peter Anvin" <hpa@...or.com>, Will Deacon <will.deacon@....com>
Subject: Re: linux-next: build warnings after merge of the access_once tree
On Thu, Mar 26, 2015 at 09:37:50AM -0700, Linus Torvalds wrote:
> On Mar 26, 2015 9:29 AM, "Peter Zijlstra" <peterz@...radead.org> wrote:
> >
> > And the size check in READ_ONCE() helps asserting this.
>
> No it d does NOT.
>
> Even the documentation you quoted agrees with me: the shearing issue is
> only for sizes where it is appropriate. The size check is wrong, because it
> warns explicitly about the sizes where the shearing will happen, but the
> code is supposed to work anyway.
>
> All the documentation documents a *special case* (although a common one),
> not some generic requirement.
>
> And the point is - the warning is wrong, and it is counterproductive. And
> it causes people who should know better to try to introduce bugs.
>
> The warning must go. This whole thread proves it. The warning is dangerous
> and actively misleading.
The only cases I can think of where this warning would be useful is
in 64-bit architecture-specific code that used u64 (or long long or
whatever) and needed to avoid both reloads and load shearing. In those
(admittedly rare, perhaps nonexistent) cases, presumably the surrounding
code should do __native_word() if needed. (In case the code were to be
mindlessly copied to a 32-bit architecture or something.)
Not sure that adding this to memory-barriers.txt is worthwhile, just
trying to make sure that I understand the tradeoffs.
Thanx, Paul
--
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