Skip to content

Backport #63 to 6.18-lts: xen/dom0: refactor dom0 memory growth to avoid splitting based on max - #67

Merged
alexandermerritt merged 7 commits into
edera/6.18-ltsfrom
backport/edera-6.18-lts/pr-63
Oct 29, 2026
Merged

alexandermerritt merged 7 commits into
edera/6.18-ltsfrom
backport/edera-6.18-lts/pr-63

Conversation

@edera-rebase-app

Copy link
Copy Markdown

Backport of #63 from edera/mainline to edera/6.18-lts (86ea419124ba), prepared by Claude. Run log.

Merge with Rebase and merge, so edera/6.18-lts stays linear.

Independent checks

Builds: success (x86_64 and arm64 vmlinux with the Edera features built in).

LTS tip before 86ea419124ba
LTS tip after 300c09f1f69c
Commits requested 7
  • New branch fast-forwards the LTS tip.
  • Backported commits are linear.
  • All 7 requested commits backported in order, each with its source's subject and identical +/- lines.

Claude's report

Claude left no report (backport step: success).

All 7 commits cherry-picked cleanly and the verifier passes. The x86_64 and arm64 builds are running; I'll write the report once they finish.

This reverts commit 0a2ac17.

Signed-off-by: Alexander M. Merritt <alexander@edera.dev>
(cherry picked from commit b0f69be)
This reverts commit 8788269.

We no longer want to split the unpopulated boot-time space between
the dom0 balloon and grant and foreign mappings.

Signed-off-by: Alexander M. Merritt <alexander@edera.dev>
(cherry picked from commit bf4463b)
This reverts commit 7498978.

Signed-off-by: Alexander M. Merritt <alexander@edera.dev>
(cherry picked from commit 857e516)
Consolidate existing duplicated code. No functional change.

Signed-off-by: Alexander M. Merritt <alexander@edera.dev>
(cherry picked from commit bfc026e)
The boot-time unbacked address space reaches the unpopulated allocator
(page_list) one 4 KiB page at a time, with a lock round trip and a list
push for each page. On a large dom0 that is millions of round trips at
boot. page_list also is unaware of page contiguity, limiting dom0
balloon growth to 4 KiB updates.

Hand each extra memory region over whole, and keep its aligned 2 MiB
blocks on a list per node, linked through the first page of each
block as page_list links pages. The pages around the blocks, and a
block that a node boundary cuts, go on page_list.

Grants and foreign mappings still take pages from page_list only.
When page_list of a node is empty, one block moves onto it, so taking
a page stays a list pop. Pages given back go on page_list and do not
form a block again.

(cherry picked from commit 2304133)
With no pages parked on the balloon, dom0 grows by hotplugging a
memory section at the first free physical address. That address space
can belong to a PCI device that has not claimed it yet, and Xen does
not stop dom0 from growing when dom0_mem sets no max:.

dom0's balloon needs room to grow into, and grows faster when Xen
populates a whole 2 MiB extent at a time. The unpopulated allocator
keeps that room, the boot-time unbacked address space. Grant and foreign
mappings and the balloon have to share it.

Feed the dom0 balloon from the allocator's 2 MiB blocks when it is
instructed to grow.

(cherry picked from commit 4870058)
Add `info/room_kb` to the sysfs of the xen balloon driver, so user tools
can discover the amount of memory dom0 can grow by. Reported are only
complete 2MiB blocks in the unpopulated allocator.

(cherry picked from commit f3450aa)
@alexandermerritt
alexandermerritt merged commit fd37e61 into edera/6.18-lts Oct 29, 2026
1 check passed
@github-actions
github-actions Bot deleted the backport/edera-6.18-lts/pr-63 branch October 29, 2026 05:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant