From patchwork Tue Jan 30 14:53:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paul E. McKenney" X-Patchwork-Id: 194200 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp1290361dyb; Tue, 30 Jan 2024 07:15:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IHm8ccOtXpyAj6BESUoUP0CtFtBDcx24kDLJkQ4arsLIZskCXK0IeyBcbEHGwD+brc2+oXn X-Received: by 2002:a17:902:70c6:b0:1d7:8382:322e with SMTP id l6-20020a17090270c600b001d78382322emr4748341plt.56.1706627740821; Tue, 30 Jan 2024 07:15:40 -0800 (PST) Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id t4-20020a170902e84400b001d5ee591d8esi7676780plg.344.2024.01.30.07.15.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 07:15:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-44774-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=A8ju5eRW; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-44774-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44774-ouuuleilei=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 sy.mirrors.kernel.org (Postfix) with ESMTPS id A4C64B2A189 for ; Tue, 30 Jan 2024 14:53:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 583698002D; Tue, 30 Jan 2024 14:53:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="A8ju5eRW" 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 827187CF1B; Tue, 30 Jan 2024 14:53:39 +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=1706626419; cv=none; b=eFb3K5KFQuWryM4meATt5085SToCnBdOVx27lWKHGPaFDy4QXG+zYJg998rGKUAaWFB8k8f/XiQnEvuVAwlerB5Zg9urhr2bDamCYXAMfOTL44Nh9fULd7lkKxZKvvemLdXuerFQwp05UFhxFdh8DUhXY/01r7UFciS12Z8Z+i0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706626419; c=relaxed/simple; bh=9747lo1ACtZ69uqd/Du/K2ueykmtwq0G3JAvq6Ljn74=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=onsDwQYj9p/yv7xQVPH+/kpb62UmxV086amhDRwWBK4MZhO0/ByerxcjdRcrTIJ/wUxGogAR/3hqJzw3jJDtIGkFF+nSAmiNbUU/N8HNtNfsvNpmnvHNfjkhBTa63ABWM3EvNrUHp0BIIBPVVNDdLPWYJbLO8OS/MGUyAJGZ4mM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=A8ju5eRW; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id DC7EAC433C7; Tue, 30 Jan 2024 14:53:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706626418; bh=9747lo1ACtZ69uqd/Du/K2ueykmtwq0G3JAvq6Ljn74=; h=Date:From:To:Cc:Subject:Reply-To:From; b=A8ju5eRWurZvU2Dc8lpdduA8a2oA/6N9GFuFVu4kbXUu8WaaP1kkTCk3X1diQ0aPH rAhrECUO8+wS2JFptCTYzpP6zQ9yjpifvCqfngdbXrX9rAtzOE/v1PD9ZrgxQGArMb 3TxfMzgK5SXWrZENSbcr6oaPEJ/rQaU/mCAl7rUFgjwPr3upDLD4zhlPFTU7py6xNZ vUAnN6ms2Qn6wo/W5yH8UrV8DF/XeHSLR6hjEiaP0Iqu6TIy+oIB5bH3ZR4NQTbCQB RDiss8vNX55DQczZ2oGO1m5B8Qc3Ox+HMmHCuhSExkxw7yUsEjmWGWboUGTrEC6Agq QrK3sUj0ufwXg== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 794B0CE0975; Tue, 30 Jan 2024 06:53:38 -0800 (PST) Date: Tue, 30 Jan 2024 06:53:38 -0800 From: "Paul E. McKenney" To: linux-kernel@vger.kernel.org, "E."@paulmck-thinkpad-p17-gen-1.smtp.subspace.kernel.org, McKenney Cc: Alan Stern , Andrea Parri , Will Deacon , Peter Zijlstra , Boqun Feng , Nicholas Piggin , David Howells , Jade Alglave , Luc Maranget , Paul@paulmck-thinkpad-p17-gen-1.smtp.subspace.kernel.org, Akira Yokosawa , Daniel Lustig , Joel Fernandes , Mark Rutland , Jonathan Corbet , linux-arch@vger.kernel.org, linux-doc@vger.kernel.org, Anna-Maria Behnsen Subject: [PATCH doc] Emphasize that failed atomic operations give no ordering Message-ID: <63d9d6f6-05e8-473d-9d09-ce8d3a33ca39@paulmck-laptop> Reply-To: paulmck@kernel.org Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789528890188337489 X-GMAIL-MSGID: 1789528890188337489 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() prefixes. 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: Andrea Parri 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: 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()