From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Borntraeger Subject: Re: linux-next: build warnings after merge of the access_once tree Date: Thu, 26 Mar 2015 20:42:03 +0100 Message-ID: <5514610B.2000707@de.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> <20150326163647.GC21418@twins.programming.kicks-ass.net> <20150326170748.GD21418@twins.programming.kicks-ass.net> <55144077.3010907@de.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Return-path: Received: from e06smtp16.uk.ibm.com ([195.75.94.112]:45441 "EHLO e06smtp16.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752101AbbCZTmK (ORCPT ); Thu, 26 Mar 2015 15:42:10 -0400 Received: from /spool/local by e06smtp16.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 26 Mar 2015 19:42:08 -0000 In-Reply-To: <55144077.3010907@de.ibm.com> Sender: linux-next-owner@vger.kernel.org List-ID: To: Peter Zijlstra , Linus Torvalds Cc: Thomas Gleixner , "linux-next@vger.kernel.org" , Stephen Rothwell , Ingo Molnar , Davidlohr Bueso , Paul McKenney , "linux-kernel@vger.kernel.org" , "H. Peter Anvin" , Will Deacon Am 26.03.2015 um 18:23 schrieb Christian Borntraeger: > Am 26.03.2015 um 18:07 schrieb Peter Zijlstra: >> On Thu, Mar 26, 2015 at 09:45:07AM -0700, Linus Torvalds wrote: >> >>> Stop this idiocy. >> >> Yeah, clearly I can type faster than I can think straight :/ >> >> >> In any case, I've the below patch; do you want to take it now or do you >> want me to route it through tip/locking/urgent or something like that? > > Its not urgent. Current upstream has a broken check (gcc will not emit the > warning if the function is static). I just fixed the check in my next tree > but I can certainly drop that tree. > Thinking more about that, the removal of the ifdef for 64bit data might be a reason to schedule that for 4.0. >> >> --- >> Subject: kernel: Remove atomicy checks from {READ,WRITE}_ONCE >> From: Peter Zijlstra >> Date: Thu, 26 Mar 2015 17:45:37 +0100 >> >> The fact that volatile allows for atomic load/stores is a special case >> not a requirement for {READ,WRITE}_ONCE(). Their primary purpose is to >> force the compiler to emit load/stores _once_. >> >> So remove the warning as it is correct behaviour. This also implies that >> the u64 case is not 64bit only, so remove the #ifdef so we can generate >> better code in that case. >> >> Cc: Stephen Rothwell >> Cc: Christian Borntraeger >> Cc: Thomas Gleixner >> Cc: Ingo Molnar >> Cc: "H. Peter Anvin" >> Cc: Davidlohr Bueso >> Cc: Paul McKenney >> Cc: Will Deacon >> Acked-by: Linus Torvalds >> Signed-off-by: Peter Zijlstra (Intel) > > Acked-by: Christian Borntraeger > > >> --- >> include/linux/compiler.h | 16 ---------------- >> 1 file changed, 16 deletions(-) >> >> diff --git a/include/linux/compiler.h b/include/linux/compiler.h >> index 1b45e4a0519b..0e41ca0e5927 100644 >> --- a/include/linux/compiler.h >> +++ b/include/linux/compiler.h >> @@ -192,29 +192,16 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); >> >> #include >> >> -static __always_inline void data_access_exceeds_word_size(void) >> -#ifdef __compiletime_warning >> -__compiletime_warning("data access exceeds word size and won't be atomic") >> -#endif >> -; >> - >> -static __always_inline void data_access_exceeds_word_size(void) >> -{ >> -} >> - >> static __always_inline void __read_once_size(const volatile void *p, void *res, int size) >> { >> switch (size) { >> case 1: *(__u8 *)res = *(volatile __u8 *)p; break; >> case 2: *(__u16 *)res = *(volatile __u16 *)p; break; >> case 4: *(__u32 *)res = *(volatile __u32 *)p; break; >> -#ifdef CONFIG_64BIT >> case 8: *(__u64 *)res = *(volatile __u64 *)p; break; >> -#endif >> default: >> barrier(); >> __builtin_memcpy((void *)res, (const void *)p, size); >> - data_access_exceeds_word_size(); >> barrier(); >> } >> } >> @@ -225,13 +212,10 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s >> case 1: *(volatile __u8 *)p = *(__u8 *)res; break; >> case 2: *(volatile __u16 *)p = *(__u16 *)res; break; >> case 4: *(volatile __u32 *)p = *(__u32 *)res; break; >> -#ifdef CONFIG_64BIT >> case 8: *(volatile __u64 *)p = *(__u64 *)res; break; >> -#endif >> default: >> barrier(); >> __builtin_memcpy((void *)p, (const void *)res, size); >> - data_access_exceeds_word_size(); >> barrier(); >> } >> } >> >