Received: by 2002:a89:288:0:b0:1f7:eeee:6653 with SMTP id j8csp95490lqh; Mon, 6 May 2024 12:22:23 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVOOUfFRiFUokaPYM8WugogmvNN2O9AAO3FfXkekTmo8LlFdLqrngP8Gua0yz1+g+9HfT7yZ+MKjDnSBCerkTFVp3y3U+MgnS82y4h2tQ== X-Google-Smtp-Source: AGHT+IETMI2tHnsCVZXs6zXUHNV10j7J3E7/JG0H3poV50BArioS/3veE40j3g2gjJUGVQT8LH3H X-Received: by 2002:a0d:dd44:0:b0:61b:418:139 with SMTP id g65-20020a0ddd44000000b0061b04180139mr9816476ywe.27.1715023342838; Mon, 06 May 2024 12:22:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715023342; cv=pass; d=google.com; s=arc-20160816; b=YDfpn+sC0xUdfPbu2o1LIH8I22OuV82bBB3JFplmatvUPON7hwNECJWhYpIdbqZYca ovgMXyCeL2UI2/AQMkUpzf6xG4h6O5ZXl9BdFHvG/I5+bOOqB9Sj4AJpw9mb4k2GHpZm NnacJK3ojxHb5O5hW0hcTvFG/KJgrW2F4EVlcF1TI++ehtuoKYxJYlTIG/QRincK2ukj XWUtZM02vBPb8WgIAlq+YUxHsxDjTUTk/ZViV12oJNjRC/PEMayniM0sDpncNRhq18VF MqS3OuMon5KYcROF7w9q+/pM/yOfhPMXwsCBnt1QZPFYcHccy3MivgLQWpZDLC8MKVVH +6RA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=z+gw7DF1RT5G8rSi5wbIl4a/5SJI8Q8A5aFo4CgtvdQ=; fh=ydL5An2t5xQwlaPc/EXpjxttJTwhEdOcizVR0g5xcmc=; b=WS2PdlDjR2Hm+olFR7AsxVgidtyPj38x+c5iZRdtn+rqb/5169H5vYQKR3bJGA8HEe DfyVfzB9yy7Aav3YPpTR9nRpb3vo/ururRbgc+Zqs4pEtGPhktTVXXXdigHjmbnGoR5h aYBjg9MkEX+fEI8L92+JIWYAdc3DulDBGNNJhfq0HiB+/XjAuOQqBhjodNpjXtr90mqp EHH3ivWSSWmu/ABdQOI89Rzdh28ZbWfGMRNO+pBasf4oXGza3Od3a+O1il3T6SCngebJ HUY66b451Bv4DyIMolCYSHtlIgxSNIof2XQDW/75NwOMOrvMRDgvE7z0hTpFdufcOQPv FKvw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=netrider.rowland.org); spf=pass (google.com: domain of linux-kernel+bounces-170331-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170331-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=harvard.edu Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id o21-20020a05622a009500b0043c97f344e4si10331670qtw.42.2024.05.06.12.22.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 May 2024 12:22:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-170331-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=netrider.rowland.org); spf=pass (google.com: domain of linux-kernel+bounces-170331-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170331-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=harvard.edu 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 BEECD1C20EDD for ; Mon, 6 May 2024 19:22:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 825991591E5; Mon, 6 May 2024 19:21:57 +0000 (UTC) Received: from netrider.rowland.org (netrider.rowland.org [192.131.102.5]) by smtp.subspace.kernel.org (Postfix) with SMTP id 99E2313C69F for ; Mon, 6 May 2024 19:21:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.131.102.5 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715023317; cv=none; b=bYsgwMk6Uptf+J/1ceMoXXpM4zoToVrf/bCb7OLycxMBDRs4k2Kd2ayY0FDWZePmza6h8OhqekeO562od/egXkXBQO055M+A9+SFy6oVp9eQRQZ4kH5UJoGW5Fk3qeWntjvfd7ncmhn5ZFnnIg6K7Ixw/+7Ad2DhM6VGGdLGwsw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715023317; c=relaxed/simple; bh=ecidPVblaFiHPOmvdtsNH/P/QiwhpZL5C6FM8X3FzSQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Ijbn7Oqlz5FGa6dOCJwL5FMu1PxcUl0pEonDHwwnkqaGkxpZnAMJY5oY/ymKtiqdMh3YZb6dHNEfXvKttxkbrkw/siKGBj3oPA09+F7Xqi8ngpsePp6dSnCNASGqU+XAee46Dlhn7KupHsW1ZjHurV7/Xu/DBoWudIvKrj4/fLo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=rowland.harvard.edu; spf=pass smtp.mailfrom=netrider.rowland.org; arc=none smtp.client-ip=192.131.102.5 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=rowland.harvard.edu Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=netrider.rowland.org Received: (qmail 888983 invoked by uid 1000); 6 May 2024 15:21:54 -0400 Date: Mon, 6 May 2024 15:21:54 -0400 From: Alan Stern To: "Paul E. McKenney" Cc: Jonas Oberhauser , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, kernel-team@meta.com, mingo@kernel.org, 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, Frederic Weisbecker , Daniel Lustig , Joel Fernandes , Mark Rutland , Jonathan Corbet , linux-doc@vger.kernel.org Subject: Re: [PATCH memory-model 2/4] Documentation/litmus-tests: Demonstrate unordered failing cmpxchg Message-ID: References: <42a43181-a431-44bd-8aff-6b305f8111ba@paulmck-laptop> <20240501232132.1785861-2-paulmck@kernel.org> <16381d02-cb70-4ae5-b24e-aa73afad9aed@huaweicloud.com> <2a695f63-6c9a-4837-ac03-f0a5c63daaaf@paulmck-laptop> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2a695f63-6c9a-4837-ac03-f0a5c63daaaf@paulmck-laptop> On Mon, May 06, 2024 at 11:00:42AM -0700, Paul E. McKenney wrote: > On Mon, May 06, 2024 at 06:30:45PM +0200, Jonas Oberhauser wrote: > > Am 5/6/2024 um 12:05 PM schrieb Jonas Oberhauser: > > > Am 5/2/2024 um 1:21 AM schrieb Paul E. McKenney: > > > > This commit adds four litmus tests showing that a failing cmpxchg() > > > > operation is unordered unless followed by an smp_mb__after_atomic() > > > > operation. > > > > > > So far, my understanding was that all RMW operations without suffix > > > (xchg(), cmpxchg(), ...) will be interpreted as F[Mb];...;F[Mb]. It's more accurate to say that RMW operations without a suffix that return a value will be interpreted that way. So for example, atomic_inc() doesn't imply any ordering, because it doesn't return a value. > > > barriers explicitly inside the cat model, instead of relying on implicit > > > conversions internal to herd. Don't the annotations in linux-kernel.def and linux-kernel.bell (like "noreturn") already make this explicit? I guess the part that is still implicit is that herd7 doesn't regard failed RMW operations as actual RMWs (they don't have a store part). Alan