Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp567022imw; Fri, 15 Jul 2022 08:39:35 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vccUhwMTAOAjQc2YjBsd7NocavlVjVq7NAPGx+hU8ty14MUKNp0blEZj5l5Kd2LeAEKWnR X-Received: by 2002:a17:907:724c:b0:72e:e6fe:5ea4 with SMTP id ds12-20020a170907724c00b0072ee6fe5ea4mr6578259ejc.421.1657899575120; Fri, 15 Jul 2022 08:39:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657899575; cv=none; d=google.com; s=arc-20160816; b=DQxgNKos5sJy1JvGO05iTbECdSDYT6OyBBQ99MdK+fD3BShmV78qUlth0sixe2KYlE HKSCV31X9KTrWsx4Jk85e4QHGwclEZXx9EJAA5wIitXIhNiuB5h957mvjSIB4k1ngTBy RG84OhYZaWsbgGqVjwf+0HR+rQ6pmpJcXxUCHWYdzTMk7yYHl1beyQdE3oUioACoI4tr hnYJhsOPhq/thoTSIIFJUfSUMWOk1OcONsKjKfFFCdFYHC1j/n2dekOhR0zPYHH1xwzQ mOOEAMBEMbODdfKn/n/0DPd6UkXoLOiHXRcFobIEQ5QuX1D+otRGhNsn1ptEeNYilhtn KO4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=RPa/0hIbJRqqyJqkLng/OTtk1XTPNr/MykZuQWTLgWM=; b=fXA0gvg98nLel+95p1zabseRWzG2/UeFSeJIqHtGbtF6ESyBaJaw8JspO8EPneItUc R6VL0zZPSir6HOnDeIBkIZfHOS1sPYCeMWLVGLiE2/qHUVRkbKJSQuOOZmvy09Dn+ESC km22S6wqqrxZsTlWWDbvTW7qSmmFe9Q5Q8XzN5G2nbnoyS0VdwSxLUPtoyBnTkV4Ztta ccOkfoeuv/6NHgnqpN8ETo+pXK8axkdWwKMXfHWVm5pSngDG2W/XijkCsOITJNzSMN6r dyP7tPgj4KIHQnaTHhooRWOgElC4UsKC9F4Ks/AgBuei7wUA+LOaWGGTRdRhSetN01rt qgbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FFYnxh8v; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ds11-20020a170907724b00b0072aba37b6aasi5883198ejc.108.2022.07.15.08.39.10; Fri, 15 Jul 2022 08:39:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FFYnxh8v; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234717AbiGOPVw (ORCPT + 99 others); Fri, 15 Jul 2022 11:21:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58820 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233509AbiGOPVt (ORCPT ); Fri, 15 Jul 2022 11:21:49 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43E631135; Fri, 15 Jul 2022 08:21:48 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id EDF44B82B3F; Fri, 15 Jul 2022 15:21:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8698DC34115; Fri, 15 Jul 2022 15:21:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657898505; bh=SeHL3z+KjgQcyJvmNfCBj4QdNfWU9NNlzqSnGnX/s2E=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=FFYnxh8vDFpJxObyCx3iqWeu/wktIdHAG1ftuu9mAg7rWsFz+tc5h+J93PTT2+15z 6nkiG1NzWNmfOvOrWXl11D0KolzzxYMtA5EzfEJypjK4i0xYt1tRSwWnb2lQmz80Jz F2FQ7SGUt37b7w9pBg1Uq5j93jhxgrBxlFgN0o5yI8ludEeSyQMyDkMn7c2ObbD1+1 sdRHcDsoi7QQiArr48uJHtttPRLAwYb0bgn4i5wQXNXQBVBCBRmzGGWLITD6eUQx6U uNDiMda04+9taFjnGjkaGjP9Q3G1ZpxAWFaOHnCiS3qu4j2C46SL6mpRX2it92jOUt xIs2FC4xPq/3A== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 246F25C015D; Fri, 15 Jul 2022 08:21:45 -0700 (PDT) Date: Fri, 15 Jul 2022 08:21:45 -0700 From: "Paul E. McKenney" To: Alan Stern Cc: Paul =?iso-8859-1?Q?Heidekr=FCger?= , clang-built-linux , linux-toolchains@vger.kernel.org, Andrea Parri , Will Deacon , Peter Zijlstra , Boqun Feng , Nicholas Piggin , David Howells , Jade Alglave , Luc Maranget , Akira Yokosawa , Daniel Lustig , Joel Fernandes , Nathan Chancellor , Nick Desaulniers , Tom Rix , Palmer Dabbelt , LKML , linux-arch , Marco Elver , Charalampos Mainas , Pramod Bhatotia , Soham Chakraborty , Martin Fink Subject: Re: [PATCH RFC] tools/memory-model: Adjust ctrl dependency definition Message-ID: <20220715152145.GZ1790663@paulmck-ThinkPad-P17-Gen-1> Reply-To: paulmck@kernel.org References: <20220615114330.2573952-1-paul.heidekrueger@in.tum.de> <50B9D7C1-B11D-4583-9814-BFFF2C80D8CA@in.tum.de> <04B4DBD6-1262-4905-9E85-9466FC104895@in.tum.de> <20F4C097-24B4-416B-95EE-AC11F5952B44@in.tum.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 15, 2022 at 09:27:26AM -0400, Alan Stern wrote: > On Fri, Jul 15, 2022 at 02:27:28PM +0200, Paul Heidekr?ger wrote: > > I have just been thinking about how to word this patch; am I correct in > > assuming that the LKMM does not deal with loop conditions? Or in other > > words, there is no way for a loop condition to impose a ctrl dependency on > > any WRITE_ONCE's in the loop body? It are only if and switch statements the > > LKMM is concerned with in the case of ctrl dependencies? > > In theory, the LKMM does say that a loop condition imposes a control > dependency on any memory accesses within the loop body. However, the > herd7 tool has only very limited support for looping constructs, so in > practice it's not possible to create suitable litmus tests with loops. And Alan isn't joking. The closest simulation that I know of is to combine limited loop unrolling with the "filter" clause. The point of the filter clause is to eliminate from consideration executions that need the more iterations of the loop to be unrolled. And that means that as far as LKMM is concerned, loop-based control dependencies are similar to those for nested "if" statements. Thanx, Paul