From nobody Mon Feb 9 11:48:00 2026 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 56699135A5C; Thu, 4 Apr 2024 19:26:52 +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=1712258812; cv=none; b=QHesjsBH7tzMOcype03eMzq9vckLVJVim2+aEXftRwfTmZvCJv1TnCF7f5pMate4F7PsFH7qh6uTeoOJjwzmkgJQta2mMnYc1kg7zFneEmvYlvQVO2pwvi5INojTmrbabGQwQBDc4nXHbK4yU9Y4Q9l6+ZqWOMJsimQcfwK0H7c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712258812; c=relaxed/simple; bh=tN99QeAtJ9rSCHUuXKIZr5kPNcQaT1UKModjibckfc0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=qRhHp33iyenvwrF8/glXtCDxK4ZEONkblJEmUWCSJflDZFvEJpLJu/nLj0Vk7RSbUTJCSAOv9OFMYbf9tkttgItZHCmsoE0XloflssQdmy6f2/QHxv9ZM/HLxYIGMrMOruQyP8YjJt35e6+NonTPR8eeIj3qQ8wLKALLWdSmEAE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=qT22pEbP; 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="qT22pEbP" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EDEC7C433A6; Thu, 4 Apr 2024 19:26:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712258812; bh=tN99QeAtJ9rSCHUuXKIZr5kPNcQaT1UKModjibckfc0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qT22pEbP/E2OyGwVmTYn6ssiRlW0RAqkAHI9aW112G6dZKGZ9fd42U+fUw7SJrzsd tHHUXWOy8nzUcvRDlHdyVUxxUn0T0cEE0QIaC3lNqQoowL0b7cv6glRyXNqNoId9+l fwEUIGRluAnCAYwKPH9a5zln4a7yXL9tT0OzrL3ntFYUPNXv/AzhMQTsge16ohyyWH r420UN+KjmJY+ICpoCD95byx65G1HNVlKGDeueiKpxkQavXt8iojAdjhsBtNL4Jq8Z JBv5mFEaY14qc2B6OYijDeijlDeaQir9ID/mU8WoBJnDkiI0Q3OqEFwsPuSH2zoLka gPALKQ6pNIUqw== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 98770CE13D0; Thu, 4 Apr 2024 12:26:51 -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/3] Documentation/atomic_t: Emphasize that failed atomic operations give no ordering Date: Thu, 4 Apr 2024 12:26:49 -0700 Message-Id: <20240404192649.531112-3-paulmck@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <8550daf1-4bfd-4607-8325-bfb7c1e2d8c7@paulmck-laptop> References: <8550daf1-4bfd-4607-8325-bfb7c1e2d8c7@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