From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752690AbbCZRMb (ORCPT ); Thu, 26 Mar 2015 13:12:31 -0400 Received: from e37.co.us.ibm.com ([32.97.110.158]:58549 "EHLO e37.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751902AbbCZRM3 (ORCPT ); Thu, 26 Mar 2015 13:12:29 -0400 Date: Thu, 26 Mar 2015 10:12:19 -0700 From: "Paul E. McKenney" To: Linus Torvalds Cc: Peter Zijlstra , Christian Borntraeger , Thomas Gleixner , "linux-next@vger.kernel.org" , Stephen Rothwell , Ingo Molnar , Davidlohr Bueso , "linux-kernel@vger.kernel.org" , "H. Peter Anvin" , Will Deacon Subject: Re: linux-next: build warnings after merge of the access_once tree Message-ID: <20150326171219.GI28980@linux.vnet.ibm.com> Reply-To: paulmck@linux.vnet.ibm.com References: <20150326193112.2c87eb39@canb.auug.org.au> <20150326103442.GV21418@twins.programming.kicks-ass.net> <20150326132750.GA2805@arm.com> <20150326142220.GY21418@twins.programming.kicks-ass.net> <20150326162857.GB21418@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15032617-0025-0000-0000-0000097EADBD Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 26, 2015 at 09:37:50AM -0700, Linus Torvalds wrote: > On Mar 26, 2015 9:29 AM, "Peter Zijlstra" 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