mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nadia Chambers <nadia.yvette.chambers@ik.me>
To: Kiryl Shutsemau <kas@kernel.org>
Cc: "David Hildenbrand (Arm)" <david@kernel.org>,
	 lsf-pc@lists.linux-foundation.org, linux-mm@kvack.org,
	x86@kernel.org, linux-kernel@vger.kernel.org,
	 Andrew Morton <akpm@linux-foundation.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	 Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	 Dave Hansen <dave.hansen@linux.intel.com>,
	Lorenzo Stoakes <lorenzo.stoakes@oracle.com>,
	 "Liam R. Howlett" <Liam.Howlett@oracle.com>,
	Mike Rapoport <rppt@kernel.org>,
	 Matthew Wilcox <willy@infradead.org>,
	Johannes Weiner <hannes@cmpxchg.org>,
	 Usama Arif <usama.arif@linux.dev>
Subject: Re: [LSF/MM/BPF TOPIC] 64k (or 16k) base page size on x86
Date: Sun, 19 Jul 2026 19:30:39 +0200	[thread overview]
Message-ID: <alzp5lvQho0nAoSS@ik.me> (raw)
In-Reply-To: <aZcxWsWO7AxQW6JC@thinkstation>

On Thu, Feb 19, 2026 at 04:39:34PM +0100, David Hildenbrand (Arm) wrote:
>> When discussing per-process page sizes with Ryan and Dev, I mentioned that
>> having a larger emulated page size could be interesting for other
>> architectures as well.
>> That is, we would emulate a 64K page size on Intel for user space as well,
>> but let the OS work with 4K pages.
>> We'd only allocate+map large folios into user space + pagecache, but still
>> allow for page tables etc. to not waste memory.
>> So "most" of your allocations in the system would actually be at least 64k,
>> reducing zone lock contention etc.

Am Do, Feb 19, 2026 um 15:54:56 +0000, Kiryl Shutsemau schrieb:
> I am not convinced emulation would help zone lock contention. I expect
> contention to be higher if page allocator would see a mix of 4k and 64k
> requests. It sounds like constant split/merge under the lock.

Presumably because the higher-order allocations would lack the per-CPU
special-case handling for order 0? IIRC LLFree is lock-free at all
allocation orders, which would likely help the zone lock specifically.
I suppose there's a sense I'm hoping my memory isn't out-of-date, but I
would still be glad to see the improvement. Extending per-CPU freelists
to small nonzero orders z.B. 4 might also help zone locks to allocate
64 KiB case likely around as much as using PAGE_MMUSHIFT == 4.


On Thu, Feb 19, 2026 at 04:39:34PM +0100, David Hildenbrand (Arm) wrote:
>> It doesn't solve all the problems you wanted to tackle on your list (e.g.,
>> "struct page" overhead, which will be sorted out by memdescs).

Am Do, Feb 19, 2026 um 15:54:56 +0000, Kiryl Shutsemau schrieb:
> I don't think we can serve 1G pages out of buddy allocator with 4k
> order-0. And without it, I don't see how to get to a viable 1G THPs.

memdescs are too recent for me to know about, but there is a comment to
make about 1 GiB superpages: doubly exponential decays in availability
are going to overwhelm the effects of any reasonable valud of
PAGE_MMUSHIFT (your ilog(PG_SIZE/PTE_SIZE) which has no macro for it)
long before 1 GiB. Bumping a small constant off the grand total of
allocation orders isn't going to be an adequate strategy. ISTR Rik van
Riel had code going round to partition RAM into something akin to
pre-formed large z.B. 1 GiB superpages that's a far more meaningful
approach to 1 GiB superpages than reducing the allocation order for
1 GiB from 18 to 14 or 12. The double exponential makes orders above
maybe 2 or 3 require migration or compaction and there's a cut-off above
which you're going to need to be either be fresh off a virgin boot or to
do something slow bordering on swsusp-style mass eviction.

If memdescs, presumably from „memory descriptors“, are something like
memory extents, I wholeheartedly endorse moves to more extent-based or
extent-like memory management and can quibble about the details later.

You can make an argument that scaling may need to take special steps to
reduce the TLB entries for the smallest page sizes so they don't
outcompete the real datasets when they proliferate. But buddy allocating
(LLFree should be used instead) isn't going to be appreciably any better
at orders 14 (PAGE_MMUSHIFT == 4) or 12 (PAGE_MMUSHIFT == 6) than 18, as
with double exponential decays, it dropped to effectively zero onf.
vmtl. 5 or 6, and values of PAGE_SIZE much larger than 64-256 KiB would
likely require far more extensive efforts to address regressions driven
by bitblitting latency and internal fragmentation than simple things like
tail packing the page cache. If you're starting from an
MMUPAGE_SIZE/PTE_SIZE of 64 KiB z.B. ppc64, it only really changes the
story to cutting 14 to 10 or 8, but the net result of that with
PAGE_MMUSHIFT == 4 is a PAGE_SIZE of 1 MiB and for PAGE_MMUSHIFT == 6 of
4 MiB, which are clearly beyond the pale of what'll be tolerable for
insb. network latencies for high-performance scenarios.

There is a case where those handfuls of buddy bitmap orders makes a
difference: if you're trying to split the difference between z.B. the
MMUPAGE_SHIFT/ilog2(PTE_SIZE) and PMD_SHIFT. That's not reaching 1 GiB,
though. That's the only real benefit possible to offer in the trivial
case of the sparse page size spectrum. Dense page size spectra like
MIPS, LoongArch, RISC-V Svnapot, and Fujitsu M12 SPARC (I presume IA64
has sadly been completely discontinued at this point) are more of where
the benefits an argument can be made for are concentrated. In the
desperation of the sparse page size spectrum case z.B. x86 page size
growth increment / Sprungweite of 9 or some Apple M5 ARM systems' 11,
trimming orders off of it might be worth it even after something in the
vein of Rik's large superpage / „huge page“ -sized arenas, but with some
devoted to the first superpage size as that's too many orders off from
MMUPAGE_SIZE for naïve handling to work well.

To be clear, I am in favour of page clustering as per your pte_size,
Andrea's hard-page-size, my pgcl (not genuinely distinct from Hugh's
except via my being a far lesser coder than he), and Hugh's larpage.
My objection is that the rationale you've given isn't sustainable.


-- nyc

  parent reply	other threads:[~2026-07-19 17:50 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-19 15:08 Kiryl Shutsemau
2026-02-19 15:17 ` Peter Zijlstra
2026-02-19 15:20   ` Peter Zijlstra
2026-02-19 15:27     ` Kiryl Shutsemau
2026-02-19 15:33 ` Pedro Falcato
2026-02-19 15:50   ` Kiryl Shutsemau
2026-02-19 15:53     ` David Hildenbrand (Arm)
2026-02-19 19:31       ` Pedro Falcato
2026-02-19 15:39 ` David Hildenbrand (Arm)
2026-02-19 15:54   ` Kiryl Shutsemau
2026-02-19 16:09     ` David Hildenbrand (Arm)
2026-02-20  2:55       ` Zi Yan
2026-07-19 17:30     ` Nadia Chambers [this message]
2026-02-19 17:09   ` Kiryl Shutsemau
2026-02-20 10:24     ` David Hildenbrand (Arm)
2026-02-20 12:07       ` Kiryl Shutsemau
2026-02-20 16:30         ` David Hildenbrand (Arm)
2026-02-20 19:33           ` Kalesh Singh
2026-02-23 11:04             ` David Hildenbrand (Arm)
2026-02-23 11:13               ` Kiryl Shutsemau
2026-02-23 11:27                 ` David Hildenbrand (Arm)
2026-02-23 12:16                   ` Kiryl Shutsemau
2026-02-23 15:14                   ` Dave Hansen
2026-02-23 15:31                     ` David Hildenbrand (Arm)
2026-02-23 15:45                       ` Kiryl Shutsemau
2026-02-23 15:49                         ` David Hildenbrand (Arm)
2026-02-23 16:22                       ` Lorenzo Stoakes
2026-02-23 16:34                     ` David Laight
2026-07-19 22:24       ` Nadia Chambers
2026-07-20  8:02         ` David Hildenbrand (Arm)
2026-07-20  8:49           ` Nadia Chambers
2026-02-19 23:24   ` Kalesh Singh
2026-02-20 12:10     ` Kiryl Shutsemau
2026-02-20 19:21       ` Kalesh Singh
2026-02-19 17:08 ` Dave Hansen
2026-02-19 22:05   ` Kiryl Shutsemau
2026-02-20  3:28     ` Liam R. Howlett
2026-02-20 12:33       ` Kiryl Shutsemau
2026-02-20 15:17         ` Liam R. Howlett
2026-02-20 15:50           ` Kiryl Shutsemau
2026-07-19  3:42   ` Nadia Chambers
2026-07-19  5:23     ` Hillf Danton
2026-02-19 17:30 ` Dave Hansen
2026-02-19 22:14   ` Kiryl Shutsemau
2026-02-19 22:21     ` Dave Hansen
2026-02-19 17:47 ` Matthew Wilcox
2026-02-19 22:26   ` Kiryl Shutsemau
2026-07-19 23:00   ` Nadia Chambers
2026-02-20  9:04 ` David Laight
2026-02-20 12:12   ` Kiryl Shutsemau
2026-07-19 22:31   ` Nadia Chambers
2026-04-29 14:39 ` Matthew Wilcox
2026-04-29 15:26   ` Kiryl Shutsemau
2026-05-01 18:05   ` David Hildenbrand (Arm)
2026-05-01 18:00 ` Kiryl Shutsemau
2026-05-01 18:02   ` David Hildenbrand (Arm)
2026-05-01 18:12     ` Kiryl Shutsemau
2026-05-01 18:31       ` David Hildenbrand (Arm)
2026-07-19  0:51 ` Nadia Chambers

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=alzp5lvQho0nAoSS@ik.me \
    --to=nadia.yvette.chambers@ik.me \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=david@kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=kas@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lorenzo.stoakes@oracle.com \
    --cc=lsf-pc@lists.linux-foundation.org \
    --cc=mingo@redhat.com \
    --cc=rppt@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=usama.arif@linux.dev \
    --cc=willy@infradead.org \
    --cc=x86@kernel.org \
    /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

Powered by JetHome