linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Christian Borntraeger <borntraeger@de.ibm.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	"linux-next@vger.kernel.org" <linux-next@vger.kernel.org>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	Ingo Molnar <mingo@elte.hu>, Davidlohr Bueso <dave@stgolabs.net>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Will Deacon <will.deacon@arm.com>
Subject: Re: linux-next: build warnings after merge of the access_once tree
Date: Thu, 26 Mar 2015 10:12:19 -0700	[thread overview]
Message-ID: <20150326171219.GI28980@linux.vnet.ibm.com> (raw)
In-Reply-To: <CA+55aFzUPPSHakwbp-Y-SaXB+o1=V6rOknz7L3AYNXNPU1MSfg@mail.gmail.com>

On Thu, Mar 26, 2015 at 09:37:50AM -0700, Linus Torvalds wrote:
> On Mar 26, 2015 9:29 AM, "Peter Zijlstra" <peterz@infradead.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

  parent reply	other threads:[~2015-03-26 17:12 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-26  8:31 linux-next: build warnings after merge of the access_once tree Stephen Rothwell
2015-03-26 10:11 ` Christian Borntraeger
2015-03-26 10:34 ` Peter Zijlstra
2015-03-26 13:27   ` Will Deacon
2015-03-26 14:22     ` Peter Zijlstra
2015-03-26 14:41       ` Will Deacon
2015-03-26 14:51         ` Peter Zijlstra
2015-03-26 15:08           ` Will Deacon
2015-03-26 16:15       ` Linus Torvalds
2015-03-26 16:21         ` Linus Torvalds
2015-03-26 16:36           ` Peter Zijlstra
2015-03-26 16:44             ` Peter Zijlstra
2015-03-26 16:45               ` Peter Zijlstra
     [not found]             ` <CA+55aFw1WHJqSj+z-mJGY-kxrg_OsGp9jK9VBi+wB4zPgCkv_w@mail.gmail.com>
2015-03-26 17:07               ` Peter Zijlstra
2015-03-26 17:17                 ` Will Deacon
2015-03-26 17:23                 ` Christian Borntraeger
2015-03-26 19:42                   ` Christian Borntraeger
2015-03-26 16:28         ` Peter Zijlstra
     [not found]           ` <CA+55aFzUPPSHakwbp-Y-SaXB+o1=V6rOknz7L3AYNXNPU1MSfg@mail.gmail.com>
2015-03-26 17:12             ` Paul E. McKenney [this message]
2015-03-26 17:24         ` Christian Borntraeger
2015-03-26 17:52           ` Linus Torvalds
2015-03-26 18:54             ` Christian Borntraeger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150326171219.GI28980@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=borntraeger@de.ibm.com \
    --cc=dave@stgolabs.net \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=sfr@canb.auug.org.au \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=will.deacon@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).