Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp196293rwb; Thu, 27 Jul 2023 11:16:06 -0700 (PDT) X-Google-Smtp-Source: APBJJlH5kZ8h14GKf/MUZ67gCnEPyVAus7SyJOt8duv/XCOdYxpRLJc6xDV0fRQj+bESGGtaNErI X-Received: by 2002:a17:907:7844:b0:98a:29ca:c58e with SMTP id lb4-20020a170907784400b0098a29cac58emr2850880ejc.27.1690481766543; Thu, 27 Jul 2023 11:16:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690481766; cv=none; d=google.com; s=arc-20160816; b=WTqz5cnzkbflzxVLN2OhJUHrmpjDlpepirC5oqJvz5zFbkWjWHHyx9T9rglsOtKD+v ZzrEAMv7eKTMyGXko2KLcNpmCt644Mo4qifg+4WAn78HiLBdhyR+mUWed7rHpGvWfqP9 EwZKs4uB5ygC1S1wQEqLgj2vRQzHCNNWKcdVRDrmuYSC4ZUztIrHOmVnRTVnOe99gvt/ IVRE5Uls54PyBuN3PO6mzEnDysO4gvUXK8t/Qj13mkOoT+v0CR4kW142zrAKotbpY531 vQSivWIMd51rFspJ1zEkpMVE0Z1sbB/U5jz3kSVXotImqqT2WML0Prw6knOkPqixjD/l NO9w== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=rHpkDybl6DzxHBnlR9NZUlPmc8EGwOUpZKKkjoKQqJI=; fh=OkBjhBMzJidpm2ZgGcBT/rLFLFzhsAw1LjvmfWgTtaQ=; b=pqrwzJk4Au9GfjBxDaOApCj7NAp3cWMIlKvna3pf1CWtArfvhVGhJDrdK2B8RZMUr/ G1ec1swib2VCPvQSNLJ20s5bb127PjSrCCg9JLRlKg0QSqnS4w85DhTS7zoDIdiee2Ql Sxt4LDc7F5Rl5bECk5dXej4wC3rgZnhMo66RuAIWStoQxIC0SwubnWjr6MvwaNeOGdju uAfmlqPHOuK/R3FUCcFR+0ZU/HLYamZCx4cBMAvat8ATOuud5iL7fJvXGCXpWICxHIG0 iI3bWwPbFEwRaNksr16hacX9f5a8i0y23y0Hswo0brxgzCJLLhVGbhhFq5hDT8CCS0IX n0Ag== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=harvard.edu Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f16-20020a1709067f9000b0099316735a60si1380888ejr.1042.2023.07.27.11.15.40; Thu, 27 Jul 2023 11:16:06 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=harvard.edu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229450AbjG0RlX (ORCPT + 99 others); Thu, 27 Jul 2023 13:41:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230397AbjG0RlV (ORCPT ); Thu, 27 Jul 2023 13:41:21 -0400 Received: from netrider.rowland.org (netrider.rowland.org [192.131.102.5]) by lindbergh.monkeyblade.net (Postfix) with SMTP id DE03A30FB for ; Thu, 27 Jul 2023 10:41:18 -0700 (PDT) Received: (qmail 11188 invoked by uid 1000); 27 Jul 2023 13:41:18 -0400 Date: Thu, 27 Jul 2023 13:41:17 -0400 From: Alan Stern To: Linus Torvalds Cc: Will Deacon , Jann Horn , paulmck@kernel.org, Andrew Morton , Peter Zijlstra , Suren Baghdasaryan , Matthew Wilcox , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrea Parri , Boqun Feng , Nicholas Piggin , David Howells , Jade Alglave , Luc Maranget , Akira Yokosawa , Daniel Lustig , Joel Fernandes Subject: Re: [PATCH 0/2] fix vma->anon_vma check for per-VMA locking; fix anon_vma memory ordering Message-ID: References: <20230726214103.3261108-1-jannh@google.com> <31df93bd-4862-432c-8135-5595ffd2bd43@paulmck-laptop> <20230727145747.GB19940@willie-the-truck> <13dc448b-712e-41ce-b74b-b95a55f3e740@rowland.harvard.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no 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 Thu, Jul 27, 2023 at 10:11:29AM -0700, Linus Torvalds wrote: > On Thu, 27 Jul 2023 at 08:44, Alan Stern wrote: > > > > This reads a little oddly, perhaps because it's a fragment from a larger > > piece of code. > > Yes. As Jann already said, this is basically a preparatory step in a > much longer sequence, and the code simply wants to make sure that any > later code (possibly quite a bit later) will not see a NULL value. ... > Do we even have the same-location rule in the LKMM? Yes. The comment in the source file calls it "Sequential Consistency Per Variable", under the category of "Fundamental coherence ordering". It applies even to plain accesses, not just to READ_ONCE or stronger. But in the presence of data races (as in the example that Will posted earlier), all bets are off. So if you want to use a plain access rather than READ_ONCE, you need to be certain that it won't race with anything. Alan Stern