From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753337AbbJNBsD (ORCPT ); Tue, 13 Oct 2015 21:48:03 -0400 Received: from mail-io0-f176.google.com ([209.85.223.176]:36289 "EHLO mail-io0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753072AbbJNBr5 (ORCPT ); Tue, 13 Oct 2015 21:47:57 -0400 Date: Wed, 14 Oct 2015 09:47:35 +0800 From: Boqun Feng To: Will Deacon Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Peter Zijlstra , Ingo Molnar , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Thomas Gleixner , "Paul E. McKenney" , Waiman Long , Davidlohr Bueso Subject: Re: [PATCH v3 6/6] powerpc: atomic: Implement cmpxchg{,64}_* and atomic{,64}_cmpxchg_* variants Message-ID: <20151014014735.GF23991@fixme-laptop.cn.ibm.com> References: <1444659246-24769-1-git-send-email-boqun.feng@gmail.com> <1444659246-24769-7-git-send-email-boqun.feng@gmail.com> <20151013132404.GI21550@arm.com> <20151013143259.GB23991@fixme-laptop.cn.ibm.com> <20151013144333.GN21550@arm.com> <20151013145830.GC23991@fixme-laptop.cn.ibm.com> <20151013150427.GP21550@arm.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Y1L3PTX8QE8cb2T+" Content-Disposition: inline In-Reply-To: <20151013150427.GP21550@arm.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --Y1L3PTX8QE8cb2T+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Oct 13, 2015 at 04:04:27PM +0100, Will Deacon wrote: > On Tue, Oct 13, 2015 at 10:58:30PM +0800, Boqun Feng wrote: > > On Tue, Oct 13, 2015 at 03:43:33PM +0100, Will Deacon wrote: > > > Putting a barrier in the middle of that critical section is probably a > > > terrible idea, and that's why I thought you were avoiding it (hence my > >=20 > > The fact is that I haven't thought of that way to implement > > cmpxchg_release before you ask that question ;-) And I'm not going to do > > that for now and probably not in the future. > >=20 > > > original question). Perhaps just add a comment to that effect, since I > >=20 > > Are you suggesting if I put a barrier in the middle I'd better to add a > > comment, right? So if I don't do that, it's OK to let this patch as it. >=20 > No, I mean put a comment in your file to explain the reason why you > override _relaxed and _acquire, but not _release (because overriding You mean overriding _acquire and fully order version, right? > _release would introduce this weird barrier in the middle of the critical > section, which would likely cause the conditional store to fail). >=20 > Will --Y1L3PTX8QE8cb2T+ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAABCAAGBQJWHbQzAAoJEEl56MO1B/q4JjIH/RtHBt8z/IElLm3upnFrejIp ffZQmRxcGNDLtreAd/xNgY2clOVWTdC1jV6J1N2aHSRj21+tdlJk/1+hed1Zj3Oj 8F/gHk35UW0J++Yg7ID8YdLF14C+hoEHJjxiAgAuSuOrp6b2tFFbB8MlVVxKOr51 9PdghSihyAaFnNO3FXQC0qoj66sdzORUAwCt/aMVKqQlSzJkaLbYrNYv8oMCwDCP P6KHtSkmvPXxfDgmKHbw3hx0zWB/LhSUXWtD6+i9H2vBNpMgwHMXAoSoNMqgBRE1 yWkMAMiSwG4wrkM70fhu2nnVwGIWnSVc6be/XavrILZJhUU4HSSmp7ArQ/OQMc8= =ptoz -----END PGP SIGNATURE----- --Y1L3PTX8QE8cb2T+--