Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp788969lqm; Wed, 1 May 2024 16:22:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXo6vdzYdNl4T8HV+DpR1ST7ebphOnwra/ykBAoVgCrIbYRQP9729p6gQ4llZqirCIBGxkbl3oAj3D144ZmzNEGnh2izJIuPYkhL/pKvw== X-Google-Smtp-Source: AGHT+IGEKsKPZXFw9WGmH+eZGxqhxx0nekar2Cmk2d6nKqihIb34XNkn7TZaK1V+i5Ud1P16eP3w X-Received: by 2002:a05:690c:ecf:b0:61b:bd65:1538 with SMTP id cs15-20020a05690c0ecf00b0061bbd651538mr4170236ywb.3.1714605724114; Wed, 01 May 2024 16:22:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714605724; cv=pass; d=google.com; s=arc-20160816; b=WFVFhYYvQn6eilvmtnnH+wy+ZF46UiSuT2ExzwO31sO0hRS1NwEtoe4ZQ7OBWKAAAV IsWgKqcHG8y9ZI2qC4MNp5IQoGjzSJLqbjS2EwR9L+EucwVh7pXA/t8SlY7blhmppIob rUC7hTagBf4uO1Q++U+Lyeor0Knc5TnRzZv3n6bzGWiXp64w0WpDR2vrtdeG0sWKj6Zi K+KWW2L8pRB9yP76iLaPJmrCLHtECwtM5Lv5vZ97xdwQ+dys5M4avtd4yo6HzpPdNUCA WcL4+CGHyt9mXLgx4mT7RbXV1AQXHOkgVLU22fsHbo+EyL238mDbBeuD4xY+Xm4B3vQs mp8g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=opco1WazxmMCHt/PThJl7CQGfE1OyiW5wzbVpDDiF1g=; fh=FGah1e950Za2EkGrj9dyX/gTuI5Iln+ZAtccSsZ9mas=; b=oWODXomsjGDZnJP0Xc9F5d2FsEsmJFwnINetFr/4IxPYqfgXdyV8ER0CqJ/E+I+JEK bXYTSdLRJqvKRTglq2E8oTKMSmLkiS0xOgeEAKeTCDB0dEv4rXSo6VUw5bIIBLauXR6Y 78gAFMfROlTYxjuLlKux6W5VxaEBIOVkXsyq6EdcdfPuCgUlYoiD0/XlC5zIQRNQuv1O qeV9suopqE1ihxB/PSI/I5El3dsprc0/GOESbBzmiLWiggDYirvXIYL6LhO6DGL2Bcdm le677BORs5dxzFBvKI0LRQcwcPhwTL55WAeNNBC0LZfnDj8c/fuBqCCxdv2fa14jkpDS mJ7A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AS96LH93; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-165840-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-165840-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id w4-20020ac857c4000000b0043abda7ce54si10018023qta.685.2024.05.01.16.22.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 May 2024 16:22:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-165840-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AS96LH93; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-165840-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-165840-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 5DD3D1C20AFA for ; Wed, 1 May 2024 23:21:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1904D16ABF8; Wed, 1 May 2024 23:21:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="AS96LH93" 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 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: 8bit 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. -Except of course when an operation has an explicit ordering like: +Except of course when a successful operation has an explicit ordering like: {}_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 Where 'unordered' is against other memory locations. Address dependencies are -not defeated. +not defeated. Conditional operations are still unordered on FAILURE. Fully ordered primitives are ordered against everything prior and everything subsequent. Therefore a fully ordered primitive is like having an smp_mb() -- 2.40.1