[00/45 RFC PATCH] 1GB superpageblock memory allocation

Rik van Riel
2026-04-30T20:22:45Z

Neither of those are great solutions, given that modern servers
tend to be large, often run multiple workloads simultaneously,
and each workload wants something else.

To address that issue, this patch series divides memory not just
into 2MB page blocks, but into PUD sized superpageblocks, and
aggressively tries to steer unmovable, reclaimable, and highatomic
allocations into those superpageblocks that have already been
"tainted" by such allocations.

The goal is to leave as many 1GB superpageblocks as possible
used by only movable allocations, so they can be easily
defragmented for either regular PMD sized huge pages, or
for PUD sized huge pages.

This series is still very much a work in progress, with lots of
work left to do, but I am posting it now (ahead of LSF/MM) in
the hopes of getting some feedback on whether this looks like
the right direction to go in.

This code has been largely written by AI, then nitpicked over
by me (with some early feedback from Johannes and Usama),
and gone through the cycle of nitpicks several times. I am
sure there are places left where the code could, and should
be better.

However, it does seem to work. On my 256GB system, I can
run syzkaller with AI automatically analyzing crashes, examining
git history for potential causes and fixes, etc, using up all
of memory. Out of the 238 superpageblocks in the normal zone,
normally less than 20 get used for unmovable and reclaimable
allocations.

I can allocate 50 1GB huge pages without driving the workload
out of memory. Presumably I could allocate a lot more if I
shut down the workload.

A number of the patches, especially later in the series,
are fixes that should be folded into earlier patches.
I hope to do that soon-ish.

In the mean time, these are probably the patches to focus
on when reviewing the ideas behind this series:
- mm: page_alloc: track actual page contents in pageblock flags
- mm: page_alloc: add per-superpageblock free lists
- mm: page_alloc: add background superpageblock defragmentation worker
- mm: page_alloc: add within-superpageblock compaction for clean superpageblocks
- mm: page_alloc: superpageblock-aware contiguous and higher order allocation

Based on 1c9982b49613