Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp1269386lqo; Fri, 17 May 2024 17:31:44 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVVSChU9tjjRQixErgfoDNB8TOUBNQH38FlY4f8nvl1lAflTvv5+P2vWvh60FePkdtLrrK4M/FG+IFViLDVQvfP1OMtFqpEncqjTJgEkA== X-Google-Smtp-Source: AGHT+IEpf5kc//L2oO0HRe2yefk5aBMQIZmfHlStXcwrrQR00bScLjWRoZhYGfXAQu6Wvp6u4jJ8 X-Received: by 2002:ac8:7d15:0:b0:43a:be54:ea0b with SMTP id d75a77b69052e-43dfdd41a54mr253931081cf.64.1715992304310; Fri, 17 May 2024 17:31:44 -0700 (PDT) Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d75a77b69052e-43e34883275si70677761cf.97.2024.05.17.17.31.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 May 2024 17:31:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-182727-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; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-182727-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-182727-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 EC6E81C212ED for ; Sat, 18 May 2024 00:31:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1CECE323D; Sat, 18 May 2024 00:31:39 +0000 (UTC) Received: from netrider.rowland.org (netrider.rowland.org [192.131.102.5]) by smtp.subspace.kernel.org (Postfix) with SMTP id D12FA383 for ; Sat, 18 May 2024 00:31:36 +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=1715992298; cv=none; b=CflL4DaFeMk19Wc+ogtYvwTWrHzFCyUb35QXAENHWFGf8A1w9gwowPpXLUNrXaObIuYO9QJMmA4lmJuzd/8nsJ0kM3k73s1+gF2glABugjjLwCBhuAeGzWnWgcfMg0iYZ/DB9FpmIeerf6awZzvGSUl7W/G/qPpG7qWdHc6HAr0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715992298; c=relaxed/simple; bh=g3RkVv+t4bcwiCbgF99DVpzGzO44nWwU895QumCSBRs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=UK2VFUEFpp9jRppIRikXmtjie8b0iXiqDrb1qFMUcoGZhqQHbcLwfYBdSUjV9MRTX83A09dgyW42JAVkyBc3R50JDu3hFyOMpvTlZQTH0UwUCwLARISV+q3ukrxgmoHcy5vb6nanB3Y4UKoXUNItES/FfZwNEd7X39NO2SQMq+w= 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 327208 invoked by uid 1000); 17 May 2024 20:31:35 -0400 Date: Fri, 17 May 2024 20:31:35 -0400 From: Alan Stern To: Hernan Ponce de Leon Cc: Jonas Oberhauser , "Paul E. McKenney" , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, kernel-team@meta.com, parri.andrea@gmail.com, boqun.feng@gmail.com, j.alglave@ucl.ac.uk, luc.maranget@inria.fr, Joel Fernandes Subject: Re: LKMM: Making RMW barriers explicit Message-ID: <2f20e7cf-7c67-4ad3-8a0c-3c1d01257ae4@rowland.harvard.edu> References: <72c804c8-2511-4349-a823-bc1de8bb729e@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=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Thu, May 16, 2024 at 10:44:05AM +0200, Hernan Ponce de Leon wrote: > On 5/16/2024 10:31 AM, Jonas Oberhauser wrote: > > > > > > Am 5/16/2024 um 3:43 AM schrieb Alan Stern: > > > Hernan and Jonas: > > > > > > Can you explain more fully the changes you want to make to herd7 and/or > > > the LKMM?? The goal is to make the memory barriers currently implicit in > > > RMW operations explicit, but I couldn't understand how you propose to do > > > this. > > > > > > Are you going to change herd7 somehow, and if so, how?? It seems like > > > you should want to provide sufficient information so that the .bell > > > and .cat files can implement the appropriate memory barriers associated > > > with each RMW operation.? What additional information is needed?? And > > > how (explained in English, not by quoting source code) will the .bell > > > and .cat files make use of this information? > > > > > > Alan > > > > > > I don't know whether herd7 needs to be changed. Probably, herd7 does the > > following: > > - if a tag called Mb appears on an rmw instruction (by instruction I > > mean things like xchg(), atomic_inc_return_relaxed()), replace it with > > one of those things: > > ? * full mb ; once (the rmw) ; full mb, if a value returning > > (successful) rmw > > ? * once (the rmw)?? otherwise > > - everything else gets translated 1:1 into some internal representation > > This is my understanding from reading the source code of CSem.ml in herd7's > repo. > > Also, this is exactly what dartagnan is currently doing. > > > > > What I'm proposing is: > > 1. remove this transpilation step, > > 2. and instead allow the Mb tag to actually appear on RMW instructions > > 3. change the cat file to explicitly define the behavior of the Mb tag > > on RMW instructions > > These are the exact 3 things I changed in dartagnan for testing what Jonas > proposed. > > I am not sure if further changes are needed for herd7. Okay, good. This answers the first part of what I asked. What about the second part? That is, how will the changes to the .def, .bell, and cat files achieve your goals? Alan