Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp891788rdb; Fri, 9 Feb 2024 04:35:49 -0800 (PST) X-Google-Smtp-Source: AGHT+IGeTERtjanQndv2xELPnuDG4KpMD4iMpQHtDbMhwSaHdxLtQCD/aWTeG9q3I1hoskQ746ov X-Received: by 2002:a05:6358:480b:b0:179:28:8056 with SMTP id k11-20020a056358480b00b0017900288056mr1163985rwn.22.1707482149385; Fri, 09 Feb 2024 04:35:49 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707482149; cv=pass; d=google.com; s=arc-20160816; b=FA0rKA+ThKgDOl6hTlNQv3Y81/8Nz3zVCOOd+tmK1aKR/HkiniDL0gJSz/hWEEkNwc xmm0xsdL+RdNRXugoPhX1p+0OGEp7IIeVQnAyl+5H5eN3AQEe57t/0HvjRs9Ag4qqKkQ zWVRFZd3dmtXxb6v7WP5uesMrTDZ9TfOihyCUM565VJQ+M8HQ7UwE1OiWG5znOT48x8a ucbZ/BiFHSpkjBTaj7/dnhCBKNNYy3qRQcF0vy/AGPkU4dX1qLtKCGpWpmHoyMQpo8NP cke0ATGsyYM5KcbAHrmKnWrRanPl4wKn9n5Ox2QHbqNM3gJ2xkp3uqkHMLmafb5hNgve rZiw== 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=18dNEwxJrEhB7NeLHVPJQaX4mwsdvUO3qtzvYzHyM1M=; fh=4m80gpHeiNDy4Mr4RxWJzLtiyFfWzMjRIqnKLClsztg=; b=oZg1v+57reYIk11EPFdWCPjVL3bVLdZIkDcPEinV4p0BTySPEy0YBcMnJoqg7jFCgg vBj6wVrMxY7AxOFDJ2CJnS2eqvTqaAZsrgMqO+XDXaulxCPDGMQqqpwBhQW9Jwf1/XC8 Blb3XEo/A7ljDsp5F41Y/rpfSE2ygUJUNcRzFN7IREkVdSKNp+XdXBc4d6/SzmUmIFSu Jv2u8+rgrMmegb10ujQOD5yovqUSizTWqqrVG+qzYB9t2om/sLdy/5+IOgYidYzud119 SpUdmwfiGysERhNs+lS/xSDzqszXp8fiRdeF25+UB/MkpiY4KPz8oyJhyoWZxSxVNCw2 +MXw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-59313-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59313-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com X-Forwarded-Encrypted: i=2; AJvYcCVqTl5kiBA4uFPvsK4bQ5YklB0BCiDkHExADZn78MZesvo2zgDyQjW7EipHwAiH2oFVZYL03VmD144MgLs9Cb9USg3sWWrBk9fXdgQzFQ== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id g22-20020a633756000000b005c1b58a321asi1645730pgn.411.2024.02.09.04.35.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 04:35:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-59313-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-59313-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59313-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id F041728618D for ; Fri, 9 Feb 2024 12:35:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6948F36B1D; Fri, 9 Feb 2024 12:35:42 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 99D3B2E64F for ; Fri, 9 Feb 2024 12:35:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707482142; cv=none; b=JVeiZay/Fe8Tf2lz7DU3OFWw4qyRx6ImijL5YmTVELrYIoWFQCKFetBcU2uZwXOSyaWOFxKTM5IpBuhvySw+RFrTBV/bWk1fPFmvtEYuIoQjtfA8qIECUt38+OxtTzSaJhaTJZgxDKca/W4rZq5mWi1NE5/0p5yN4Dq58kNdAYc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707482142; c=relaxed/simple; bh=hGkM3G5UeVZcuUc4avua0lxN7fCk4ZwrzRH5E6PJnIE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=hkFHvj4ufGYiZC8JiMebbiF1Debrz3kAWi8OBxyhxzVhDa7WVNR8ga64LJOJq7iJK8VL3GPJSZv6UUst//w200+6/8LTv5k7oi50wJCYYx+1UmR+GsGdpOu2g+Ej6lb6aNq9CnAwWD4GuqrhFOMcayx83YeiyUY8xsDsvtwg5JA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C9D7ADA7; Fri, 9 Feb 2024 04:36:20 -0800 (PST) Received: from FVFF77S0Q05N.cambridge.arm.com (FVFF77S0Q05N.cambridge.arm.com [10.1.31.163]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 67F463F5A1; Fri, 9 Feb 2024 04:35:37 -0800 (PST) Date: Fri, 9 Feb 2024 12:35:09 +0000 From: Mark Rutland To: Nhat Pham Cc: linux-kernel@vger.kernel.org, boqun.feng@gmail.com, frederic@kernel.org, joel@joelfernandes.org, neeraj.iitr10@gmail.com, paulmck@kernel.org, peterz@infradead.org, will@kernel.org Subject: Re: [PATCH] locking/atomic: scripts: clarify ordering of conditional atomics Message-ID: References: <20240129122250.1086874-1-mark.rutland@arm.com> <20240206184005.4125128-1-nphamcs@gmail.com> 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: <20240206184005.4125128-1-nphamcs@gmail.com> On Tue, Feb 06, 2024 at 10:40:05AM -0800, Nhat Pham wrote: > Let me bring in some beginners' perspective :) > > For the most part, LGTM! My only comment is regarding the conditional > atomics with relaxed ordering on success: > > /** > * If (@v == @old), atomically updates @v to @new with relaxed ordering. > + * Otherwise, @v is not modified and no ordering is provided. > > This is technically correct, but it can be confusing. It reads as if > "relaxed ordering" is much different from no ordering, since we are > juxtaposing them when we compare what happens when the condition holds > v.s when it does not. > > This can be potentially confusing to unfamiliar users. I consulted > with Paul about this, and he suggested this rewording, which I like > better: > > "Otherwise, @v is not modified and relaxed ordering is provided." I agree that makes sense, and doing the same in the commit message makes that simpler and clearer too! > With something along that line in place: > Reviewed-by: Nhat Pham Thanks; I'll fold the above in for v2. Mark.