Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1634243rwd; Thu, 1 Jun 2023 19:56:58 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4cmOCG1NXXtsFOF8Csphybx6p0Ms4rgz2lf7AfqURp8qyzqF5DuWaR0DM72XyuwNPN3hdr X-Received: by 2002:a05:622a:1489:b0:3f3:8f39:3473 with SMTP id t9-20020a05622a148900b003f38f393473mr13220085qtx.26.1685674618730; Thu, 01 Jun 2023 19:56:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685674618; cv=none; d=google.com; s=arc-20160816; b=i9Vuw+c3X5Q915jNMgL5lUGubTjjw1ZUvsY00bC142ZnK+c/L/WUkY3ve4ldzIB6fs WEXP76AvC0/s/rl//kycnX4UMKaW7vi1nOwF7HRs2UD3d72G3k03WJSSxhwuwLtDcitY qTwZ5neNW90en4CpVdKnvEvJkDoGNfJtGwY44L/jsEk9XIQrdfPvX7UrKgDXTwp/NVpM Hw2o1ReaeNOxlk6gIaemGhD8+ZLFGWz2ebABD+X4aHHtNBxEf5jDHd+wCoKmG6GfR5vV OLLj8BZBWnFs+SfA57n6M2mkQ930X8IMxF6B/CpQsNb4wdd293lXbK1kjMZxGrMrrAtB 3oOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date:dkim-signature; bh=SF8Aly25fzS1LbEgHf3gEAMX1PFPP+yipG6c4kJY9FQ=; b=SbR0GfBYJtKW95DSCxXlL/9X/xyvCMMG2bje1HBELkMOeYZSMD64XEp27KdkVVZD6Y a4e7u51QP+857ptg46J/jYWeDwPcDQN7EJEjffXfvxOzHAg8+8+RkLg+VQIi9kPnxoXo +jFteMVhcNWeY3DQGgGHc8zHv1LUc8HR9nSNR2Yu0uRnxjKTfwXLzyQTl2KRIYuzLn3v +Z80onguLEAdYgyoipIocPW5//WOPVe+kU86aNLjbb2pRlvytwiWmhRHDsshil6H2XGk 7pL2DrCwnqIyVzz28g9ktjzQy58FoRbduJMJQCq3hL7TtqZO6BbenyWk1vcktbOlLGK5 3NNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=Rk5FbB+o; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o25-20020a637319000000b0053fec3ed061si212422pgc.718.2023.06.01.19.56.45; Thu, 01 Jun 2023 19:56:58 -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=@google.com header.s=20221208 header.b=Rk5FbB+o; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233006AbjFBCbS (ORCPT + 99 others); Thu, 1 Jun 2023 22:31:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229524AbjFBCbR (ORCPT ); Thu, 1 Jun 2023 22:31:17 -0400 Received: from mail-yb1-xb2f.google.com (mail-yb1-xb2f.google.com [IPv6:2607:f8b0:4864:20::b2f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 964F2180 for ; Thu, 1 Jun 2023 19:31:16 -0700 (PDT) Received: by mail-yb1-xb2f.google.com with SMTP id 3f1490d57ef6-bacf5b89da7so1640620276.2 for ; Thu, 01 Jun 2023 19:31:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1685673076; x=1688265076; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to; bh=SF8Aly25fzS1LbEgHf3gEAMX1PFPP+yipG6c4kJY9FQ=; b=Rk5FbB+oAsrW8gZLb52SCCgKNsAmEqKYhOWM8mNovBu8VmM2uqP80AqT4JPjGmAkeF VCtjMjWEtncedQVl2suK2B9fG0YSu8ZDA/tlOrxLqonUjBDQrJOxs3lbfBBI/7Sfd52T F79+e4SbJdZWyOrach4YIr3gP3pRI1VMsJQiaCKv9seUQXwDdTbO8u52AhRq3Z9QMf95 kPtCWY4hlVNHWYQvyoIEOMRbI+1a3QdcLlXwIu/X6EycrGuwLME9rtPwCQwbUpoqvelY 438yqErUCjUNHPjps7KhCyOa0fzNX7M1hAaywgxQzZmew+OtFGVSCWpsqVFUU1qJ+4gm 4+KQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685673076; x=1688265076; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=SF8Aly25fzS1LbEgHf3gEAMX1PFPP+yipG6c4kJY9FQ=; b=VOSNaq6g/gAsC3wnF1fEZ8X0R6ZIHwYjnYMg+BOHSy1z7cEM6ZABvU1xcqWTsoe6n/ vPL5Rhg4t5cR3xD85uejHD6UD7z+Jh6r+QlmaZDgVKObnT0BZEtdh/nOJDwj3VRoL2Dq QgQwp26mN/aHihl46upSCcDYk+RsHS1T7oPH/AThs1voJPHwyTNcHeurzzyE4/3awyMz +37uWpWKGDDHebKvLn4nA1HXnfa8c3AF3e50gwTugaZyNUkE9fz4AILnkNjsVnNtkEoy jJ5KzNa/eNzonWputSFDFwK8uuHY008ijOEdc+049MDJsDjWGOgIMnf64AeWNLEYz4Lv 66LA== X-Gm-Message-State: AC+VfDydpYx87BECmD/35XjUd/RjHljG7zyhq7sOKN1lYnjyXDG58p01 QJtt2DbLHZ7zUTXZSE3LhceuGg== X-Received: by 2002:a81:6c48:0:b0:559:e954:edf8 with SMTP id h69-20020a816c48000000b00559e954edf8mr11588651ywc.6.1685673075667; Thu, 01 Jun 2023 19:31:15 -0700 (PDT) Received: from ripple.attlocal.net (172-10-233-147.lightspeed.sntcca.sbcglobal.net. [172.10.233.147]) by smtp.gmail.com with ESMTPSA id l190-20020a0de2c7000000b0055a7ff0a5cdsm54005ywe.27.2023.06.01.19.31.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Jun 2023 19:31:15 -0700 (PDT) Date: Thu, 1 Jun 2023 19:31:05 -0700 (PDT) From: Hugh Dickins X-X-Sender: hugh@ripple.attlocal.net To: Peter Xu cc: Hugh Dickins , Andrew Morton , Mike Kravetz , Mike Rapoport , "Kirill A. Shutemov" , Matthew Wilcox , David Hildenbrand , Suren Baghdasaryan , Qi Zheng , Yang Shi , Mel Gorman , Peter Zijlstra , Will Deacon , Yu Zhao , Alistair Popple , Ralph Campbell , Ira Weiny , Steven Price , SeongJae Park , Naoya Horiguchi , Christophe Leroy , Zack Rusin , Jason Gunthorpe , Axel Rasmussen , Anshuman Khandual , Pasha Tatashin , Miaohe Lin , Minchan Kim , Christoph Hellwig , Song Liu , Thomas Hellstrom , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH 01/31] mm: use pmdp_get_lockless() without surplus barrier() In-Reply-To: Message-ID: References: <68a97fbe-5c1e-7ac6-72c-7b9c6290b370@google.com> <34467cca-58b6-3e64-1ee7-e3dc43257a@google.com> <427ea01f-345a-6086-d145-fe573894dbe@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL 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, 26 May 2023, Peter Xu wrote: > > The other confusing thing on this _lockless trick on PAE is, I think it > _might_ go wrong with devmap.. > > The problem is here we assumed even if high & low may not match, we still > can rely on most pte/pmd checks are done only on low bits (except _none() > check) to guarantee at least the checks are still atomic on low bits. > > But it seems to me it's not true anymore if with pmd_trans_huge() after > devmap introduced, e.g.: I agree that there would likely be a problem for p??_devmap() on 32-bit PAE: but (I hope I followed the chain correctly!) I had earlier found that pmd_devmap() can only return true when CONFIG_ZONE_DEVICE=y, and config ZONE_DEVICE depends on ARCH_HAS_PTE_DEVMAP, and ARCH_HAS_PTE_DEVMAP is only selected (in some cases) by arm64, powerpc if PPC_BOOK3S_64, and x86 if X86_64. So I stopped worrying about devmap. Hugh