From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Schwab Subject: Re: [PATCH -v2 14/33] locking,m68k: Implement atomic_fetch_{add,sub,and,or,xor}() Date: Mon, 20 Jun 2016 19:47:00 +0200 Message-ID: <87twgniwh7.fsf@linux-m68k.org> References: <20160531101925.702692792@infradead.org> <20160531102642.333689893@infradead.org> <20160616101309.GD30921@twins.programming.kicks-ass.net> <20160617154024.GY30154@twins.programming.kicks-ass.net> Mime-Version: 1.0 Content-Type: text/plain Return-path: In-Reply-To: <20160617154024.GY30154@twins.programming.kicks-ass.net> (Peter Zijlstra's message of "Fri, 17 Jun 2016 17:40:24 +0200") Sender: linux-kernel-owner@vger.kernel.org To: Peter Zijlstra Cc: Geert Uytterhoeven , Linus Torvalds , Ingo Molnar , Thomas Gleixner , Will Deacon , Paul McKenney , boqun.feng@gmail.com, waiman.long@hpe.com, =?utf-8?B?RnLDqWTDqXJpYw==?= Weisbecker , "linux-kernel@vger.kernel.org" , Linux-Arch , Richard Henderson , Vineet Gupta , Russell King , Hans-Christian Noren Egtvedt , Miao Steven , Yoshinori Sato , Richard Kuo , Tony Luck , James Hogan , Ralf Baechle , David Howells Ja List-Id: linux-arch.vger.kernel.org Peter Zijlstra writes: > Could either of you comment on the below patch? > > All atomic functions that return a value should imply full memory > barrier semantics -- this very much includes a compiler barrier / memory > clobber. I wonder if it is possible to find a case where this makes a real difference, ie. where the compiler erroneously reused a value due to the missing barrier. Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-out.m-online.net ([212.18.0.9]:36275 "EHLO mail-out.m-online.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753334AbcFTRrM (ORCPT ); Mon, 20 Jun 2016 13:47:12 -0400 From: Andreas Schwab Subject: Re: [PATCH -v2 14/33] locking,m68k: Implement atomic_fetch_{add,sub,and,or,xor}() References: <20160531101925.702692792@infradead.org> <20160531102642.333689893@infradead.org> <20160616101309.GD30921@twins.programming.kicks-ass.net> <20160617154024.GY30154@twins.programming.kicks-ass.net> Date: Mon, 20 Jun 2016 19:47:00 +0200 In-Reply-To: <20160617154024.GY30154@twins.programming.kicks-ass.net> (Peter Zijlstra's message of "Fri, 17 Jun 2016 17:40:24 +0200") Message-ID: <87twgniwh7.fsf@linux-m68k.org> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-arch-owner@vger.kernel.org List-ID: To: Peter Zijlstra Cc: Geert Uytterhoeven , Linus Torvalds , Ingo Molnar , Thomas Gleixner , Will Deacon , Paul McKenney , boqun.feng@gmail.com, waiman.long@hpe.com, =?utf-8?B?RnLDqWTDqXJpYw==?= Weisbecker , "linux-kernel@vger.kernel.org" , Linux-Arch , Richard Henderson , Vineet Gupta , Russell King , Hans-Christian Noren Egtvedt , Miao Steven , Yoshinori Sato , Richard Kuo , Tony Luck , James Hogan , Ralf Baechle , David Howells , "James E.J. Bottomley" , Michael Ellerman , Martin Schwidefsky , Rich Felker , "David S. Miller" , cmetcalf@mellanox.com, Max Filippov , Arnd Bergmann , dbueso@suse.de, Wu Fengguang , linux-m68k Message-ID: <20160620174700.dJQN5RLe-M2y5r2OJQlh71LGHPztvAKmdqFyyLVvEHA@z> Peter Zijlstra writes: > Could either of you comment on the below patch? > > All atomic functions that return a value should imply full memory > barrier semantics -- this very much includes a compiler barrier / memory > clobber. I wonder if it is possible to find a case where this makes a real difference, ie. where the compiler erroneously reused a value due to the missing barrier. Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."