Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751984AbdFKNy5 (ORCPT ); Sun, 11 Jun 2017 09:54:57 -0400 Received: from mail-pg0-f66.google.com ([74.125.83.66]:35739 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751651AbdFKNy4 (ORCPT ); Sun, 11 Jun 2017 09:54:56 -0400 Date: Sun, 11 Jun 2017 21:56:32 +0800 From: Boqun Feng To: Peter Zijlstra Cc: Will Deacon , Paul McKenney , linux-kernel@vger.kernel.org, Ingo Molnar , Thomas Gleixner Subject: Re: [RFC][PATCH]: documentation,atomic: Add a new atomic_t document Message-ID: <20170611135632.sl72klbeklelupej@tardis> References: <20170609092450.jwmldgtli57ozxgq@hirez.programming.kicks-ass.net> <20170609154442.GB9236@arm.com> <20170609193604.ncw3hhgvewzc3h5u@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="2fgxitnzw6jkm3fu" Content-Disposition: inline In-Reply-To: <20170609193604.ncw3hhgvewzc3h5u@hirez.programming.kicks-ass.net> User-Agent: NeoMutt/20170225 (1.8.0) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1913 Lines: 68 --2fgxitnzw6jkm3fu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Peter, On Fri, Jun 09, 2017 at 09:36:04PM +0200, Peter Zijlstra wrote: [...] > > > +Ordering: (go read memory-barriers.txt first) > > > + > > > +The rule of thumb: > > > + > > > + - non-RmW operations are unordered; > > > + > > > + - RmW operations that have no return value are unordered; > > > + > > > + - RmW operations that have a return value are Sequentially Consiste= nt; > >=20 > > I think it's stronger than that, because they also order non-RmW operat= ions, > > whereas this makes it sounds like there's just a total order over all R= mW > > operations. >=20 > Right, what should I call it? >=20 I think the term we use to refer this behavior is "fully-ordered"? Could we give it a slight formal definition like: a. memory operations preceding and following the RmW operation is Sequentially Consistent. b. load or store part of the RmW operation is Sequentially Consistent with operations preceding or following. Though, sounds like defining "fully-ordered" is the job for memory-barriers.txt, but it's never done ;-) Regards, Boqun > > > + - RmW operations that are conditional are unordered on FAILURE, oth= erwise the > > > + above rules apply. > >=20 --2fgxitnzw6jkm3fu Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEj5IosQTPz8XU1wRHSXnow7UH+rgFAlk9TA0ACgkQSXnow7UH +rgiJQf/QNoaSL61wyu0vr77KKbKb6WgbrL5xglrM37Y8wlzIWl5bQolEYgWZreo Ad6+gCCsx3O3+7LaixO9sMzC3Vz9o64JxJy2R2wNLOI2KVM/p6wenCjo899MPGX/ oQSadppDkHQPw4s48iwOX8+MyguJDG1i81hZ8zeKCXtttRxF0bN/3Ds9ne/0eyM6 rlHpZOow94WzleEQgx5LpCvJFk0cNyI+teeINcPli/9i65mzHT7eyYdv8wGPhUXG uAfB1VAk9U9jOY2dGAXzdjlDRN3tdyyBUcPlkVb21mOT+eQ/X+XeyIoUcRY6unTw F1aIsqXEqu+CfBTCU6yfYTrIxzufPA== =vKMD -----END PGP SIGNATURE----- --2fgxitnzw6jkm3fu--