Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp265391lqb; Thu, 23 May 2024 18:38:24 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVbaLqUmlpM7f6aDWQ1NtU6o4jZsZfa/Fnbe+9ztFcqK7tPvluNAHfOGPuiDFa1W6zuIHliQV/LbG98UnxvsAZ8ybAwmbNORoz3ZgT5Hg== X-Google-Smtp-Source: AGHT+IH56tfyAWMCN7ImMKaw9024bHQnJEArIx2VUkEcIpu32U3PyCXzcV6aUHLaFPo5mds6eyJJ X-Received: by 2002:a17:90b:4b4e:b0:2be:b9:da18 with SMTP id 98e67ed59e1d1-2bf5e13707cmr897717a91.2.1716514704251; Thu, 23 May 2024 18:38:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716514704; cv=pass; d=google.com; s=arc-20160816; b=IAjh9nYd40+xXnqMmDfyIDv6Yln5/UgfpRSxQRPwmI07s9o69MNUtd9U4GCBl7rjMd D2DDglKLi4fjo4x8dZSjdtahnOCBSR0VgtHeJO8dZPmcCJF2IH3PatR25xO4zceyfded 2qyUw8MuKm2M4nnIVOyYHHtiEjgwiot1h+co8NtWo80Es+DC2b7+SS8SH9h1TrrHMuyv TFys+kGE9xT4yHBfMRBJb8USiUAbKjJQ/m7t9zD/0v4JoT9ZVPsrprgRON8RsGbjU8ej daXooPndc9z7ma93aocJ611U9FJ96iQ0wOhNX5S/1RROEOfjy8iIkfRctCbiGXJ1USFl MNPg== 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=W4cJQDc9rrhXD+moVI6pU4GxWw0D63/S7dE7zknBTWw=; fh=hWAM0tpRcbCF3gkq2PE9I2CgLpDPXPypUYnSfPtWbkY=; b=sZcsD8bZztDeOHvZYTG6S+oyi9Ck3oGrru5uYw3zIO0tq+tEd4lk02quPKPW6ddM5d 3eroI4uPDROf547GuhUJBZLlaLGiFGoixzyI7ua3UtS51uiydMxGVykgzgDLCg8zCzxc icEP2aa69oWA2kq0DQH7NSBUM7T23/uTEWfFugIubH0QVqJPUkI/PoWVEh4CgfKgI73m EZNSitkzMMhrEdUFyvLka4XHM18bAoUADKALFxWOJJkjVVBACv0haxunh9bbaO3FXwEI 8UwhKe7UKIjdThTVK38/iC91QO8zkFPbyZj/yIEe516cI82Fe/BRskRUYNLWX+gQzOhp k1mw==; 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-188210-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-188210-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=harvard.edu Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2bf5fe62168si453716a91.140.2024.05.23.18.38.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 May 2024 18:38:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-188210-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=netrider.rowland.org); spf=pass (google.com: domain of linux-kernel+bounces-188210-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-188210-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 2F167283442 for ; Fri, 24 May 2024 01:38:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4A1C779C8; Fri, 24 May 2024 01:38:15 +0000 (UTC) Received: from netrider.rowland.org (netrider.rowland.org [192.131.102.5]) by smtp.subspace.kernel.org (Postfix) with SMTP id CB23D6FBF for ; Fri, 24 May 2024 01:38:12 +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=1716514694; cv=none; b=ayUUuCvdRYctVP8ld21ZNCmOoyJ45XmkdSPxILFVeRG9fnH5BkupDSwVDyRWJ+AwHLlqthafWbq1NTRUdU/cgzUcqEG73o2UHnVeYTxIziM7v/8UMxmrnBc8C9qm5jZHwRdRR0t9SbTm3b5kn5QaRXPw2mQPcaYioipo4Oi/1cA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716514694; c=relaxed/simple; bh=ktrOGz4jaFDISDmSHOKX/oWCftbzkGJXeQ+Rov6/IaU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=I5xb+CHfycLBjCrIBdjZC+EVnGUJP5kwnpYSzZ6oYiZOZGm3g05pVLDI2VQWubk1Y/29olUcrqzQTnHB2Cw+Z7tIBc122UKnG03cgQAJjc6mHeThJa0VYFBW+NndiQ8WXMnNIGH8z54eU/B3AfmR+MU64fwWrT6GPSpuIvhhDyg= 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 559173 invoked by uid 1000); 23 May 2024 21:38:05 -0400 Date: Thu, 23 May 2024 21:38:05 -0400 From: Alan Stern To: Boqun Feng Cc: Hernan Ponce de Leon , Jonas Oberhauser , "Paul E. McKenney" , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, kernel-team@meta.com, parri.andrea@gmail.com, j.alglave@ucl.ac.uk, luc.maranget@inria.fr, Joel Fernandes Subject: Re: LKMM: Making RMW barriers explicit Message-ID: References: <2f20e7cf-7c67-4ad3-8a0c-3c1d01257ae4@rowland.harvard.edu> <0c309dd3-f8c1-4945-b8f1-154b2a775216@huaweicloud.com> <4286e5b2-5954-4c77-a815-c1c2735d9509@rowland.harvard.edu> <58042cf3-e515-4e5f-ab48-1d0d6123c9e9@huaweicloud.com> <6174fd09-b287-49ae-b117-c3a36ef3800a@rowland.harvard.edu> <7bd31eca-3cf3-4377-a747-ec224262bd2e@huaweicloud.com> <35b3fd07-fa85-4244-b9cb-50ea54d9de6a@rowland.harvard.edu> 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: On Thu, May 23, 2024 at 08:14:38AM -0700, Boqun Feng wrote: > Besides, I'm not sure this is a good idea. Because the "{mb}, {once}, > etc" part is a syntax thing, you write a cmpxchg(), it should be > translated to a cmpxchg event with MB tag on. As to failed cmpxchg() > doesn't provide ordering, it's a semantics thing, as Jonas showed that > it can be represent in cat file. As long as it's a semanitc thing and we > can represent in cat file, I don't think we want herd to give a special > treatment. I don't really understand the distinction you're making between syntactic things and semantic things. For most instructions there's no problem, because the instruction does just one thing. But a cmpxchg instruction can do either of two things, depending on whether it succeeds or fails, so it makes sense to tell herd7 how to represent both of them. > What you and Jonas looks fine to me, since it moves the semantic bits > from herd internal to cat file. Trying to recognize failed RMW events by looking for R events with an mb tag that aren't in the rmw relation seems very artificial. That fact that it would work is merely an artifact of herd7's internal actions. I think it would be much cleaner if herd7 represented these events in some other way, particularly if we can tell it how. After all, herd7 already does generate different sets of events for successful (both R and W) and failed (only R) RMWs. It's not such a big stretch to make the R events it generates different in the two cases. Alan