Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp18440lqb; Tue, 28 May 2024 07:48:03 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXgIxUEMj7cVziIcNidB3Quy7B7Cw2I2YbjrT/fLWqdZJaxN0TvT7uV9FJIm7vcsQNZDsHv8iyJ2Pa2HpYKaud799UMMSE2CQUBEWWx6g== X-Google-Smtp-Source: AGHT+IHxS4v/u1ZVcbbT1frdeNA0jStR/E6IS5MojTbxg3DXmOcz0JmpIdX8hoRReF4FqFf4DTcu X-Received: by 2002:a17:903:22c8:b0:1f0:67ea:cdf8 with SMTP id d9443c01a7336-1f4497df7b5mr172515135ad.46.1716907683109; Tue, 28 May 2024 07:48:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716907683; cv=pass; d=google.com; s=arc-20160816; b=zv6hTv79ZlOTCGEPDO5ecr0dkOAbxn/RQaJcJIRDpfnJxKNQz7MQKNPxL1ilBUm2mi LLnhcxA7uUpz+DJheo3XVjPFGfAlbtF2rmSjt6Uwk6YbBNWUAXcFDmKlY7SWhVRrFGnY ty5kkGkZ6hUyI0CLYHv36iY6mtX4MKpLsPCs1B8b7MqNxl9qWdouXqmWYtcqPSplOjC9 yiHQQHZ/9fPTHR+ji+RpQHufihHaR7ZKvdMdQlsOVAMbXp0qwPEc0jMPg8JjnI1gWu9l piRq4GkRIEY4/gQ5mCT9vfG5velgSHISqqVji6wFOn3OyvAszwBDHTpadX1E6hVlaJRn 7fwg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to:subject :user-agent:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:date:message-id; bh=xsUSgGHO+Jh57JmDCjEaEeZCNs8YDrR+jQ8Adjus4tk=; fh=i0oKwYr3se86bjqvT5ejzEL+Uwv1t86l54su9c3eADQ=; b=I5S+YP14o7sDuAV+H6Zz2GXBw2TXWpqoFTW5eKOzQ+bsq2G/XOEzZK9a1W5RnKEz43 cTFqezmGygfj7QWvUaWwPsKJOdCLbp3k3d5pVbC4Rll0FPHfNqn6YueiZM69mYdZrOxa fw6+KlOEjHM4jayOTtuRe9fKAY8J5OZCj+aEnLKDQ9eLZ2W35kfQesqXyg2h3U9uQYAF p7/NKCVdG28BEf7B/4H6nkKEbhLVwEmFbZ+K4+VSzzPq1J4FL4S2hUtZVdbna47O7g/I wGgB2jIlvTFoQaRnTdNefhr/zuXYktRGNPfmSA4cUlUZWqMb652wm8tvzPgHBw1IGPE1 oWoA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-192566-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-192566-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id d9443c01a7336-1f44c9af787si80368895ad.437.2024.05.28.07.48.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 07:48:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-192566-linux.lists.archive=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; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-192566-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-192566-linux.lists.archive=gmail.com@vger.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 D663CB22807 for ; Tue, 28 May 2024 14:46:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 61FED16FF30; Tue, 28 May 2024 14:46:35 +0000 (UTC) Received: from frasgout12.his.huawei.com (frasgout12.his.huawei.com [14.137.139.154]) (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 939BE107A0 for ; Tue, 28 May 2024 14:46:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=14.137.139.154 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716907594; cv=none; b=do3GfoZ2iV7nsNqNCgg/nUrupD8sL2UBdgciZcXrmUvYiXPadzA8h+qBzUexhP28ckv6iMsoExkANVLrv0pQnShtJs+wuErmuzLuq5wKHOtmSNVpR847sgCoYHnAdewSXC2k6rI7qMRHokyfZMKxEqi0jewW4vhH0t+sC5/wYFA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716907594; c=relaxed/simple; bh=vLqVlrQmFst6uvCZmManf+IPjEYT46APy0CdgiX3KFg=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=N6RHruP/6N+SgP7daga8oh6McsjN8UGunA9m1XPzGJue8xnTP7ilYhFgSQMLvmRAdLzMmxA689eflupBw6Gc0TocP+6fOQbFj7hIXetNm0NmKr6OEwBA0VDxPa3tushm2I8Njp3+MyWP+7axc/MelB0HSrgOQbqzh1Q/8GJNZBU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com; spf=pass smtp.mailfrom=huaweicloud.com; arc=none smtp.client-ip=14.137.139.154 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huaweicloud.com Received: from mail.maildlp.com (unknown [172.18.186.51]) by frasgout12.his.huawei.com (SkyGuard) with ESMTP id 4VpZX03nw9z9v7Jk for ; Tue, 28 May 2024 22:24:16 +0800 (CST) Received: from mail02.huawei.com (unknown [7.182.16.27]) by mail.maildlp.com (Postfix) with ESMTP id B81E11404F0 for ; Tue, 28 May 2024 22:46:14 +0800 (CST) Received: from [10.206.134.102] (unknown [10.206.134.102]) by APP2 (Coremail) with SMTP id GxC2BwBXkCQp7lVmHb4SCQ--.53411S2; Tue, 28 May 2024 15:46:14 +0100 (CET) Message-ID: Date: Tue, 28 May 2024 16:45:58 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC][PATCH 4/4] tools/memory-model: Distinguish between syntactic and semantic tags To: Alan Stern Cc: paulmck@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, dlustig@nvidia.com, joel@joelfernandes.org, urezki@gmail.com, quic_neeraju@quicinc.com, frederic@kernel.org, linux-kernel@vger.kernel.org References: <20240527152253.195956-1-jonas.oberhauser@huaweicloud.com> <20240527152253.195956-5-jonas.oberhauser@huaweicloud.com> <5ce0c8a3-bd9c-475a-9427-7edef47a90f2@rowland.harvard.edu> From: Jonas Oberhauser In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-CM-TRANSID:GxC2BwBXkCQp7lVmHb4SCQ--.53411S2 X-Coremail-Antispam: 1UD129KBjvJXoW7Kw4fGrWUurWxWF17JF1rCrg_yoW8ArWkpF WIqa1Fkr4DJayayw4ktr1IqFyFv34FgFW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rote: >>>> +let Mb = MB \ FailedRMW >>>>>> (* Compute marked and plain memory accesses *) >>>> -let Marked = (~M) | IW | Once | Release | Acquire | domain(rmw) | range(rmw) | >>>> +let Marked = (~M) | IW | ONCE | RELEASE | ACQUIRE | MB | domain(rmw) | range(rmw) | >>> >>> The new MB term isn't needed, because MB tags on memory accesses are >>> filtered out unless the access also belongs to domain(rmw) | range(rmw). >>> >>> Alan >> >> >> Thanks for all the notes. >> I think on this one is needed though under the assumption that herd7 would >> no longer know internally to replace the MB with ONCE in case >> of failure. > Hmmm, this raises another question: Shouldn't the R event for a failed > cmpxchg_release count as marked? Yes. > At the moment it's not clear how such > events will be tagged. If by "at the moment" you mean the current herd7, then (as mentioned in the cover letter) this patch does not work at all with the current herd7 because IIUC in fact ACQUIRE and RELEASE tags will be replaced by Once in all cases (so smp_store_release would be a store Once ...). However, in a hypothetical version of herd7 which just leaves all the syntactic tags intact, we would get R & RMW & RELEASE, which would not be in the Release set (by nature of failing and being a read) but would be Marked (by nature of having a syntactic RELEASE tag). > Perhaps the best thing to do is add RMW to > this list, which would make domain(rmw) and range(rmw) unnecessary. That's also a good idea. > And then we probably don't need to keep MB That's correct, although as a failsafe I would probably keep it anyways - it doesn't harm, but it may prevent a gotcha. Have fun, jonas