CP-53658: Claim memory on a single NUMA node#6369
Merged
Merged
Conversation
e5fef8f to
b3cb4dd
Compare
last-genius
reviewed
Mar 21, 2025
lindig
approved these changes
Mar 24, 2025
c5b6e1f to
905f18c
Compare
Member
Author
|
The call claim_pages fails when ballooning is involved and most of the memory in the host is being used, it needs a few changes to ignore these errors and plow ahead, just like before. |
905f18c to
886e0a6
Compare
Member
Author
|
Tested both in XS8 and XS9 with the two reverted patches, and it works:
I've also manually tested that the VM that restart works. I've seen that parallel starts are are also fixed |
886e0a6 to
ed010a1
Compare
Member
In spite of the spelling, I understood this sentence. |
robhoes
reviewed
Apr 2, 2025
a380f3a to
221dc53
Compare
robhoes
reviewed
Apr 2, 2025
Many years ago, 'maybe' used to be a synonym for Option.iter, Option.map and other functions. Use Option.x directly to avoid any misunderstnadings Signed-off-by: Pau Ruiz Safont <pau.ruizsafont@cloud.com>
…ifetime Signed-off-by: Pau Ruiz Safont <pau.ruizsafont@cloud.com>
Now the numa node needs to be passed. A special value of -1n is used to signify that no node is meant to be used. Since this is arch-dependent, a Nativeint.t is used to encode the value. Signed-off-by: Pau Ruiz Safont <pau.ruizsafont@cloud.com>
This binding is only available in Xen 4.21 (unreleased) Signed-off-by: Pau Ruiz Safont <pau.ruizsafont@cloud.com>
Previously unit was returned every single time, but the result of the inner function will need to be used in the near future. Signed-off-by: Pau Ruiz Safont <pau.ruizsafont@cloud.com>
Xen currently supports to modes to claim memory for a domain: without any node in particular, or claim memory in a single NUMA node. When planning a domain, return the nodes that will host the domain, and how much memory. In the case where the domain fits in a single NUMA node, claim pages on that node, otherwise fall back to previous behaviour. The memory claims need to happen while the memory measurements hold valid, that is while no VMs are started, otherwise ENOMEM might be returned. Because the current mode is a best-effort, log when the claim does not work. Signed-off-by: Pau Ruiz Safont <pau.ruizsafont@cloud.com>
Neither xenguest nor emu-manager support passing the parameter just yet, so avoid passing the numa node to create the parameter. On top of that claiming memory conflicts with DMC, so it's better to keep previous behaviour of not claiming any pages before allocating. Signed-off-by: Pau Ruiz Safont <pau.ruizsafont@cloud.com>
221dc53 to
9e6fb15
Compare
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.
This PR allows xenopsd to launch domains that are using memory allocated in a single NUMA node in a reliable way. (when restarting a VM in a host with most of the memory in use)
Since this is only supported by Xen with this patchqueue: https://lists.xen.org/archives/html/xen-devel/2025-03/msg01127.html, and it needs support from xenguest and emu-manager, there are two commits that revert the changes to just claim memory pages without a NUMA memory node. These are easily revertable by patches to enable this functionality in cutting edge builds.
Revertable patches: