From: Matthew Wilcox <willy@infradead.org>
To: David Hildenbrand <david@redhat.com>
Cc: Zi Yan <ziy@nvidia.com>,
Baolin Wang <baolin.wang@linux.alibaba.com>,
akpm@linux-foundation.org, hannes@cmpxchg.org,
lorenzo.stoakes@oracle.com, Liam.Howlett@oracle.com,
npache@redhat.com, ryan.roberts@arm.com, dev.jain@arm.com,
vbabka@suse.cz, rppt@kernel.org, surenb@google.com,
mhocko@suse.com, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] mm: convert do_set_pmd() to take a folio
Date: Thu, 8 May 2025 14:12:04 +0100 [thread overview]
Message-ID: <aBytpMWqzfjgIy4U@casper.infradead.org> (raw)
In-Reply-To: <a5056791-0a3e-40f6-bb83-7f39ef76b346@redhat.com>
On Thu, May 08, 2025 at 09:36:02AM +0200, David Hildenbrand wrote:
> > > Which raises an interesting question: I assume in the future, when we have a 4 MiB folio on x86-64 that is *misaligned* in VA space regarding PMDs (e.g., aligned to 1 MiB but not 2 MiB), we could still allow to use a PMD for the middle part.
> >
> > It might not be possible if the folio comes from buddy allocator due to how
> > buddy allocator merges a PFN with its buddy (see __find_buddy_pfn() in mm/internal.h).
> > A 4MB folio will always be two 2MB-aligned parts. In addition, VA and PA need
> > to have the same lower 9+12 bits for a PMD mapping. So PMD mappings for
> > a 4MB folio would always be two PMDs. Let me know if I miss anything.
>
> PA is clear. But is mis-alignment in VA space impossible on all
> architectures? I certainly remember it being impossible on x86-64 and s390x
> (remaining PMD entry bits used for something else).
Yeah, that's not possible; the PMD is always PMD-aligned.
next prev parent reply other threads:[~2025-05-08 13:12 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-07 9:26 [PATCH 1/2] mm: khugepaged: convert set_huge_pmd() " Baolin Wang
2025-05-07 9:26 ` [PATCH 2/2] mm: convert do_set_pmd() " Baolin Wang
2025-05-07 12:10 ` Matthew Wilcox
2025-05-07 12:36 ` Baolin Wang
2025-05-07 16:47 ` Matthew Wilcox
2025-05-08 2:23 ` Baolin Wang
2025-05-08 7:37 ` David Hildenbrand
2025-05-07 21:24 ` David Hildenbrand
2025-05-07 23:46 ` Zi Yan
2025-05-08 7:36 ` David Hildenbrand
2025-05-08 13:12 ` Matthew Wilcox [this message]
2025-05-07 12:04 ` [PATCH 1/2] mm: khugepaged: convert set_huge_pmd() " Matthew Wilcox
2025-05-07 21:19 ` David Hildenbrand
2025-05-08 2:08 ` Baolin Wang
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=aBytpMWqzfjgIy4U@casper.infradead.org \
--to=willy@infradead.org \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=baolin.wang@linux.alibaba.com \
--cc=david@redhat.com \
--cc=dev.jain@arm.com \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lorenzo.stoakes@oracle.com \
--cc=mhocko@suse.com \
--cc=npache@redhat.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