linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Christophe Leroy (CS GROUP)" <chleroy@kernel.org>
To: Wei Yang <richard.weiyang@gmail.com>
Cc: akpm@linux-foundation.org, david@kernel.org,
	lorenzo.stoakes@oracle.com, Liam.Howlett@oracle.com,
	vbabka@suse.cz, rppt@kernel.org, surenb@google.com,
	mhocko@suse.com, ziy@nvidia.com, baolin.wang@linux.alibaba.com,
	npache@redhat.com, ryan.roberts@arm.com, dev.jain@arm.com,
	baohua@kernel.org, lance.yang@linux.dev, linux-mm@kvack.org
Subject: Re: [PATCH] mm: use standard page table accessors
Date: Wed, 26 Nov 2025 11:28:37 +0100	[thread overview]
Message-ID: <16ae0a30-c6ee-40ad-98c8-ee6f4713e653@kernel.org> (raw)
In-Reply-To: <20251126100330.n66n3uvt3junflao@master>



Le 26/11/2025 à 11:03, Wei Yang a écrit :
> On Wed, Nov 26, 2025 at 09:15:24AM +0100, Christophe Leroy (CS GROUP) wrote:
>>
>>
>> Le 26/11/2025 à 07:47, Wei Yang a écrit :
>>> Use standard page table accessors i.e pxdp_get() to get the value of
>>> pxdp.
>>
>> Please provide more detail of why you want to do that and how you are sure it
>> doesn't break existing implementation.
>>
>> There was similar tentative in the past already which proved to give
>> suboptimal results, see discussion here:
>>
>> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flore.kernel.org%2Fall%2Ff40ea8bf-0862-41a7-af19-70bfbd838568%40csgroup.eu%2F&data=05%7C02%7Cchristophe.leroy%40csgroup.eu%7C63a7608567de4df0a16308de2cd31076%7C8b87af7d86474dc78df45f69a2011bb5%7C0%7C0%7C638997482180349327%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=ly4LRRjkKqQNBY6ZpkbHS7%2B0xuu2c1r0op1eysPtbSQ%3D&reserved=0
> 
> Interesting.
> 
> The reason is P4D/PUD/PMD on PPC32 actually just has PGD/PMD. So it is not
> necessary to retrieve P4D and PUD.

More exactly, PPC32 just has PGD and PTE, no PMD either:

arch/powerpc/include/asm/book3s/32/pgtable.h:#include 
<asm-generic/pgtable-nopmd.h>
arch/powerpc/include/asm/nohash/32/pgtable.h:#include 
<asm-generic/pgtable-nopmd.h>


> 
> If this is the case, sounds other platform with less pagetable level would be
> affected too.

Indeed.

> 
> And this looks only affect when we walk the pagetable from pgd. If we just
> iterating pmd/pte, we won't have this issue, right?

Maybe. I have not looked at your changes in details, it just lit up a 
memory in my mind.

Christophe



  reply	other threads:[~2025-11-26 10:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-26  6:47 Wei Yang
2025-11-26  8:15 ` Christophe Leroy (CS GROUP)
2025-11-26 10:03   ` Wei Yang
2025-11-26 10:28     ` Christophe Leroy (CS GROUP) [this message]
2025-11-26 12:15       ` Wei Yang
2025-11-26  9:09 ` David Hildenbrand (Red Hat)
2025-11-26  9:42   ` Wei Yang
2025-11-26 10:19   ` Ryan Roberts
2025-11-26 11:32     ` Ryan Roberts

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=16ae0a30-c6ee-40ad-98c8-ee6f4713e653@kernel.org \
    --to=chleroy@kernel.org \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=baohua@kernel.org \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=david@kernel.org \
    --cc=dev.jain@arm.com \
    --cc=lance.yang@linux.dev \
    --cc=linux-mm@kvack.org \
    --cc=lorenzo.stoakes@oracle.com \
    --cc=mhocko@suse.com \
    --cc=npache@redhat.com \
    --cc=richard.weiyang@gmail.com \
    --cc=rppt@kernel.org \
    --cc=ryan.roberts@arm.com \
    --cc=surenb@google.com \
    --cc=vbabka@suse.cz \
    --cc=ziy@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox