Repository navigation
Backport #63 to 6.18-lts: xen/dom0: refactor dom0 memory growth to avoid splitting based on max - #67
Merged
Conversation
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)
3 of 4 tasks
alexandermerritt
approved these changes
Oct 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #63 from
edera/mainlinetoedera/6.18-lts(86ea419124ba), prepared by Claude. Run log.Merge with Rebase and merge, so
edera/6.18-ltsstays linear.Independent checks
Builds: success (x86_64 and arm64 vmlinux with the Edera features built in).
86ea419124ba300c09f1f69cClaude's report
Claude left no report (backport step: success).