Re: [RFC PATCH 00/11] mm: NUMA-aware boot memory carving (extmem)
From: Suseendran Bhaskaran
Date: Thu Dec 03 2026 - 12:02:26 EST
Hi Dave,
Thank you for your feedback. Agree that the cover letter jumped to the
solution too quickly. Here is the goal and reasoning behind it.
On Wed, Dec 02, 2026 at 04:34:59PM -0800, Dave Hansen wrote:
> I think this jumps to the solution space far too quickly. What is the
> actual goal? What does the carve-out achieve?
>
> Do you just want to do your own memory allocation? Are you trying to
> reduce 'struct page' overhead?
The goal is to let DAX/libnvdimm consumers use normal DRAM
without x86-only hardcoded memmap=nn!ss ranges (which break when memory
layout changes) or per-host firmware setup (EFI_MEMORY_SP): e.g.
/dev/daxX.Y for guest VMs persisting in place across live updates, or
/dev/pmemX for fsdax where block-filesystem semantics are needed instead
of tmpfs.
Primary requirements (as in the other sub-thread):
1. Arch-agnostic across ACPI x86_64, ACPI arm64, and DT arm64 without
per-host firmware changes.
2. NUMA-aware partitioning (keeping System RAM on every node) without
hardcoding physical addresses or firmware holes.
3. Preserving the exact ranges across KHO kexec.
For allocation, yes: consumers allocate out of /dev/daxX.Y (or fsdax)
directly via existing DAX and libnvdimm drivers, not a new kernel
allocator.
Reducing 'struct page' overhead is a secondary benefit. Boot skips
~16 MiB/GiB (4 KiB pages); post-bind, the overhead depends on how the
region is bound (e.g. raw pmem uses none and huge-page-aligned
device_dax on x86_64 shares tail vmemmap pages).
>> - Runtime memory offlining cannot guarantee 1 GiB physical contiguity
>> after early allocations (and boot RAM cannot be offlined on arm64).
>
> Could you talk a bit more about this, please? You're talking about
> limitations of the existing implementation, right? Why, for instance, is
> enhancing runtime memory offlining to fix this not an option?
Yes, some of the problems are current implementation constraints. Even
if lifted, I feel a few gaps remain with runtime offlining:
- Across KHO kexec, live ranges must be excluded early; post-boot
offlining runs too late on unpreserved RAM. kho_preserve_pages() and
reserve_mem= are already early-boot reservations and keep the range
as reserved System RAM, blocking DAX bind.
- On cold boot, 1 GiB PUD mappings in device_dax (x86_64) need
1 GiB-aligned chunks. One unmovable page would block offlining its
whole memory block.
- Offlining leaves the range as IORESOURCE_SYSTEM_RAM, so DAX requires
hot-removing boot memory blocks and re-adding them as ZONE_DEVICE.
In-kernel helpers exist (offline_and_remove_memory()), but it still
initializes and tears down boot struct pages on every boot.
If you'd like to suggest a better approach for the requirements,
I'd be happy to look into it.
Thanks,
Suseendran