From mboxrd@z Thu Jan 1 00:00:00 1970 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 B9642C7EE2A for ; Fri, 2 Jun 2023 02:31:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233240AbjFBCbT (ORCPT ); Thu, 1 Jun 2023 22:31:19 -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-Google-Smtp-Source: ACHHUZ4cgTUzJ+I9GJTslrfb2kQp5ZIcpj6rwg2qfGWXxU6xTSlqIS15v9Ch7w6GF0mPj/rbe8cH6g== 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 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