From nobody Thu Dec 18 07:28:48 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2420E168AEC; Wed, 1 May 2024 23:21:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714605695; cv=none; b=aOEp/5GZ9VZMzAluGnLbh4w6yKo3ji+ktEf/qK7vN5/GPYru6ZEFB/f1YEH8xHjGRJqGBVxYVUhTS96R1CuaoIYfXWFDjIw4c52QFsM7yVeY01BgUg+EmfvakGXl+MKIIgO0Ti/Orj6gj1caN5S8y0+3AzUctNytFkKxFWD2qT0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714605695; c=relaxed/simple; bh=tN99QeAtJ9rSCHUuXKIZr5kPNcQaT1UKModjibckfc0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=HDyBrj9pKijnCeS6FPM1hXl565JnqZtoKQL2R2lK+opNc10yF2oSSUKDwebPNIVFNoiKSC/4TKK00quOzLq5dyx8lnZOpuC94gjV8DZ7RWvi5z6BxwYuJYWf8yGOM57lVVAswzdj3fAtsCgB/Zgs0S0YV3N1Ne8jP/RjM4insc4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=AS96LH93; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="AS96LH93" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C6B9EC4AF1A; Wed, 1 May 2024 23:21:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714605694; bh=tN99QeAtJ9rSCHUuXKIZr5kPNcQaT1UKModjibckfc0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AS96LH93+Xv7uqyFVwP7Ifz/QqcBdBaP5BGxQ4L0EAKdW6laZio2vPkeRSX6XRuKE xZJvNqkbdAOtJLv6R/FSAflXrHWOP5kQS4UFIE6lCBffZuLWzagw0pvF3rHTIysJ62 hBcLQcvkVn8NWM+SoK5K0vkJATmyO7aVfGwvAKRJrBSxWANKtyE2slV8h30k98amrx +rCjY+9VY+m9Vlc7LOAmKOZqhCK3H5xnkh5SzAE3LRfmaN+xlVItrgESbIVnMLO41l ATk9IXV/NjDDBos5BU++QwnyulVUIwu9SOHINzQBhyP65F6c+UdwggBy02KOwdq3iM G3bcO0UI+DoXg== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 6A93DCE1415; Wed, 1 May 2024 16:21:34 -0700 (PDT) From: "Paul E. McKenney" To: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, kernel-team@meta.com, mingo@kernel.org Cc: stern@rowland.harvard.edu, parri.andrea@gmail.com, will@kernel.org, peterz@infradead.org, boqun.feng@gmail.com, npiggin@gmail.com, dhowells@redhat.com, j.alglave@ucl.ac.uk, luc.maranget@inria.fr, akiyks@gmail.com, "Paul E. McKenney" , Anna-Maria Behnsen , Daniel Lustig , Joel Fernandes , Mark Rutland , Jonathan Corbet , linux-doc@vger.kernel.org Subject: [PATCH memory-model 3/4] Documentation/atomic_t: Emphasize that failed atomic operations give no ordering Date: Wed, 1 May 2024 16:21:31 -0700 Message-Id: <20240501232132.1785861-3-paulmck@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <42a43181-a431-44bd-8aff-6b305f8111ba@paulmck-laptop> References: <42a43181-a431-44bd-8aff-6b305f8111ba@paulmck-laptop> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The ORDERING section of Documentation/atomic_t.txt can easily be read as saying that conditional atomic RMW operations that fail are ordered when those operations have the _acquire() or _release() suffixes. This is not the case, therefore update this section to make it clear that failed conditional atomic RMW operations provide no ordering. Reported-by: Anna-Maria Behnsen Signed-off-by: Paul E. McKenney Cc: Alan Stern Cc: Will Deacon Cc: Peter Zijlstra Cc: Boqun Feng Cc: Nicholas Piggin Cc: David Howells Cc: Jade Alglave Cc: Luc Maranget Cc: "Paul E. McKenney" Cc: Akira Yokosawa Cc: Daniel Lustig Cc: Joel Fernandes Cc: Mark Rutland Cc: Jonathan Corbet Cc: Cc: Acked-by: Andrea Parri Acked-by: Mark Rutland --- Documentation/atomic_t.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/atomic_t.txt b/Documentation/atomic_t.txt index d7adc6d543db4..bee3b1bca9a7b 100644 --- a/Documentation/atomic_t.txt +++ b/Documentation/atomic_t.txt @@ -171,14 +171,14 @@ The rule of thumb: - RMW operations that are conditional are unordered on FAILURE, otherwise the above rules apply. =20 -Except of course when an operation has an explicit ordering like: +Except of course when a successful operation has an explicit ordering like: =20 {}_relaxed: unordered {}_acquire: the R of the RMW (or atomic_read) is an ACQUIRE {}_release: the W of the RMW (or atomic_set) is a RELEASE =20 Where 'unordered' is against other memory locations. Address dependencies = are -not defeated. +not defeated. Conditional operations are still unordered on FAILURE. =20 Fully ordered primitives are ordered against everything prior and everythi= ng subsequent. Therefore a fully ordered primitive is like having an smp_mb() --=20 2.40.1