Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 57E94C05027 for ; Mon, 13 Feb 2023 00:54:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229574AbjBMAyc (ORCPT ); Sun, 12 Feb 2023 19:54:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229436AbjBMAya (ORCPT ); Sun, 12 Feb 2023 19:54:30 -0500 Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com [IPv6:2a00:1450:4864:20::232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9D7E5240 for ; Sun, 12 Feb 2023 16:54:28 -0800 (PST) Received: by mail-lj1-x232.google.com with SMTP id a9so12907916ljr.13 for ; Sun, 12 Feb 2023 16:54:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Dz+a3mPWtoysx88tn67g1rPbKFZYyy96xE3GUFKUHts=; b=H5UiGmapwOiGC1yt24WxT2LWYXaMz3wEtskkj9kcQXVyellCrNwOPGnVImX0VpssPP NlF6rXCNLk9VLnUtqRsNipGu5yP4b+9Pi/HW3ClyaLEgnj3Eks069hz6gG0VCHoj/RWX 8c/CLn7mAKJmcUwuTdI2nzoOGNJ0y5KKw+J3o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Dz+a3mPWtoysx88tn67g1rPbKFZYyy96xE3GUFKUHts=; b=W77HPUlEKmIHERKMsxHwvYPOWgRbq9SzJsVxPKr1UACykAULxaSN8MbmSpd/8kHFyM fOJWLD03o6h6Pc8nhcxCxpQ/QsQoesO1EAWzuR2QhjPXFB5KA8u6u9kRgUvzETB81BZq +dJCGwAKt6k9OT67XZIkJl8Tva0x3m+JxAD5eeHkNUQvWiRl50kJ6xeBxcK9fKilqvWL Vefs9V0EN2K9zEfU3rKfMl9wf23Sf1Ih5w7nty1gWrgE5wg5TAsc1UzsPUBIZnQkf/J6 46BPRQF1yquxtRux6Zq3eTPrBGfP9DMwrirn+umK7Ba8Woxxrx9qUgfNBNQyElfVMYam Zfqw== X-Gm-Message-State: AO0yUKWC4+nkEVk2uA7gHIlYHf/7vYR2qRcro1MeunOWt7klOoiPZpLV z97GEJHa8w1FcFB6MuhFTekG+gSqPUJ8I2s+HW9l0w== X-Google-Smtp-Source: AK7set/ZwJcDlthA7ojaCtH1HvCYwIA2SFhRWcxCP4DA/PdYuRinjHeX1iAlU+S6JOWl2/XfVkKBYMa6d9THdcgN/sg= X-Received: by 2002:a2e:2f1e:0:b0:293:25c1:808f with SMTP id v30-20020a2e2f1e000000b0029325c1808fmr2873798ljv.154.1676249666804; Sun, 12 Feb 2023 16:54:26 -0800 (PST) MIME-Version: 1.0 References: <20230204004843.GA2677518@paulmck-ThinkPad-P17-Gen-1> <20230204014941.GS2948950@paulmck-ThinkPad-P17-Gen-1> <20230204222411.GC2948950@paulmck-ThinkPad-P17-Gen-1> In-Reply-To: From: Joel Fernandes Date: Sun, 12 Feb 2023 19:54:15 -0500 Message-ID: Subject: Re: Current LKMM patch disposition To: Alan Stern Cc: "Paul E. McKenney" , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, kernel-team@meta.com, mingo@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 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Feb 11, 2023 at 9:59 PM Alan Stern wrote: [...] > > is kind of why I want to understand the CAT, because for me > > explanation.txt is too much at a higher level to get a proper > > understanding of the memory model.. I tried re-reading explanation.txt > > many times.. then I realized I am just rewriting my own condensed set > > of notes every few months. > > Would you like to post a few examples showing some of the most difficult > points you encountered? Maybe explanation.txt can be improved. Just to list 2 of the pain points: 1. I think it is hard to reason this section "PROPAGATION ORDER RELATION: cumul-fence" All store-related fences should affect propagation order, even the smp_wmb() which is not A-cumulative should do so (po-earlier stores appearing before po-later). I think expanding this section with some examples would make sense to understand what makes "cumul-fence" different from any other store-related fence. 2. This part is confusing and has always confused me " The happens-before relation (hb) links memory accesses that have to execute in a certain order" It is not memory accesses that execute, it is instructions that execute. Can we separate out "memory access" from "instruction execution" in this description? I think ->hb tries to say that A ->hb B means, memory access A happened before memory access B exactly in its associated instruction's execution order (time order), but to be specific -- should that be instruction issue order, or instruction retiring order? AFAICS ->hb maps instruction execution order to memory access order. Not all ->po does fall into that category because of out-of-order hardware execution. As does not ->co because the memory subsystem may have writes to the same variable to be resolved out of order. It would be nice to call out that ->po is instruction issue order, which is different from execution/retiring and that's why it cannot be ->hb. ->rf does because of data flow causality, ->ppo does because of program structure, so that makes sense to be ->hb. IMHO, ->rfi should as well, because it is embodying a flow of data, so that is a bit confusing. It would be great to clarify more perhaps with an example about why ->rfi cannot be ->hb, in the "happens-before" section. That's really how far I typically get (line 1368) before life takes over, and I have to go do other survival-related things. Then I restart the activity. Now that I started reading the CAT file as well, I feel I can make it past that line :D. But I never wanted to get past it, till I built a solid understanding of the contents before it. As I read the file more, I can give more feedback, but the above are different 2 that persist. Thanks! - Joel