xen: Introduce NUMA-aware claim sets for domains
cover xen: Introduce NUMA-aware claim sets for domains
Hi all,
This series extends Xen's memory claim handling to support claim sets spanning multiple NUMA nodes.
Earlier review raised the concern that claims would need to evolve from a single claim into a multi-node model. Roger Pau Monné described the core requirement well:
Quoted 3 lines
Ideally, we would need to introduce a new hypercall that allows making claims from multiple nodes in a single locked region, as to ensure success or failure in an atomic way.
-- Roger Pau Monné
This series implements that model.
A claim set can contain multiple node-specific claims and an optional global claim for memory that may come from any NUMA node. The new domctl installs the full claim set atomically, and the allocator is updated so that claim checks and claim consumption follow the new semantics.
The series has been reworked substantially in response to earlier review. Because of that, it is likely best reviewed as a fresh series rather than incrementally.
Patch summary:
1. xen/mm: Refactor retiring claims in preparation for use in functional changes
2. xen/mm: Claims check: Allow free pages to cover a shortfall of claims
3. xen/mm: Optimise getting free page counts per NUMA node
4. xen/mm: Split d->outstanding_pages to global_claims & node_claims
5. xen/mm: Introduce Claim Sets for multiple NUMA nodes
The design document submitted ahead of this series may also help with review. It explains the background, design rationale, and implementation details.
Rendered version:
https://bernhardk-xen-review.readthedocs.io/node-claims-v5/designs/claims/
Posted version:
https://lists.xenproject.org/archives/html/xen-devel/2026-04/msg00108.html
Many thanks to everyone who contributed to the earlier work and review, especially Alejandro Vallejo, Jan Beulich, Andrew Cooper, Roger Pau Monné, Marcus Granado, and Edwin Török.
Thanks for your review.
Bernhard Kaindl
Bernhard Kaindl (5):
xen/mm: Refactor retiring claims in preparation for functional changes xen/mm: alloc pages: Allow free pages to cover a shortfall of claims xen/mm: Optimise getting free page counts per NUMA node xen/mm: Split d->outstanding_pages to global_claims & node_claims xen/mm: Introduce Claim Sets for multiple NUMA nodes
tools/include/xenctrl.h | 4 + tools/libs/ctrl/xc_domain.c | 38 +++ xen/common/domctl.c | 56 +++- xen/common/page_alloc.c | 379 ++++++++++++++++++++++++++-- xen/include/public/domctl.h | 32 +++ xen/include/public/memory.h | 9 + xen/include/xen/mm.h | 3 + xen/include/xen/sched.h | 13 +- xen/xsm/flask/hooks.c | 1 + xen/xsm/flask/policy/access_vectors | 1 + 10 files changed, 509 insertions(+), 27 deletions(-)
Signature · 1 line
2.39.5
PATCH 1/5 xen/mm: Refactor retiring claims in preparation for functional changes
Refactor retiring claims into a function to make the claims accounting model easier to follow ahead of adding functional changes.
Those functional changes are NUMA claims and retiring claims when offlining pages if all those pages on the host are claimed. For these functional changes, we need to return the number of retired claims.
---
This 1st commit of this series is shared with another series which fixes a number of bugs in reserve_offline_page(). If you could ack it to be merged independent of the review of this series, we can shave it off both series in the next review rounds of both series.
History:
Except from the function name change and extending it to return the number of retired pages (which is required by both series) this commit is the equivalent of commit 1 of the NUMA claims series v4, with minor changes:
1) The review comments have been applied.
2) In earlier series, I had chosen to use "releasing" and "consuming". Instead, speak of "retiring" claims (as they are no longer active), which can be used in all contexts, when using the claim for an allocation, when resetting a claim and when we've to recall claims when offlining.
2) The 2nd function made sense to be migrated to be part of the main NUMA claims commit so it is no longer a part of this commit.
--- xen/common/page_alloc.c | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-)
xen/common/page_alloc.c +20 -7
@@ -518,6 +518,24 @@ unsigned long domain_adjust_tot_pages(struct domain *d, long pages)return d->tot_pages; } +/* Retire a portion of the global claims of a domain on global memory */ +static unsigned long claims_retire_global (struct domain *d, +unsigned long pages_to_retire) +{ +unsigned long retired; + +ASSERT (spin_is_locked (&heap_lock)); + +/* If the withdrawal is larger than the claims, don't withdraw beyond */ + retired =min (d->outstanding_pages +0UL , pages_to_retire); + +/* Assert the invariant of outstanding_claims not going negative */ +ASSERT (retired <= outstanding_claims); + outstanding_claims -= retired; + d->outstanding_pages -= retired; +return retired; +} +int domain_set_outstanding_pages (struct domain *d,unsigned long pages) {int ret = -ENOMEM ;
@@ -535,8 +553,7 @@ int domain_set_outstanding_pages(struct domain *d, unsigned long pages)/* pages==0 means "unset" the claim. */ if ( pages ==0 ) { - outstanding_claims -= d->outstanding_pages; - d->outstanding_pages =0 ; +claims_retire_global (d, d->outstanding_pages); ret =0 ; goto out; }
@@ -1067,11 +1084,7 @@ static struct page_info *alloc_heap_pages(* the domain being destroyed before creation is finished. Losing part * of the claim makes no difference. */ -unsigned long outstanding =min (d->outstanding_pages +0UL , request); - -BUG_ON (outstanding > outstanding_claims); - outstanding_claims -= outstanding; - d->outstanding_pages -= outstanding; +claims_retire_global (d, request); }check_low_mem_virq ();
Signature · 1 line
2.39.5
PATCH 2/5 xen/mm: alloc pages: Allow free pages to cover a shortfall of claims
In reply to Bernhard KaindlWhen an allocation has a shortfall of claims but free, unclaimed memory can cover this shortfall, allow the allocation to proceed.
In preparation for NUMA claims, refactor this check into a reusable function. This will enable the same logic to be applied for NUMA nodes.
---
Changes since v4: Extracted into a dedicated patch and merged the formerly separate functions into one, as suggested by Jan Beulich.
--- xen/common/page_alloc.c | 41 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 38 insertions(+), 3 deletions(-)
xen/common/page_alloc.c +38 -3
@@ -873,6 +873,42 @@ static void check_and_stop_scrub(struct page_info *head) } } +/* +* Allow the request when unclaimed pages suffice, or when a refcounted +* domain's outstanding claims cover the shortfall. +*/ +static bool claims_permit_request (const struct domain *d, +unsigned long avail_pages, +unsigned long competing_claims, +unsigned int memflags, +unsigned long requested_pages) +{ +unsigned long unclaimed_pages; + +ASSERT (spin_is_locked (&heap_lock)); +ASSERT (avail_pages >= competing_claims); + +/* Start from the free pages not already claimed by other domains. */ + unclaimed_pages = avail_pages - competing_claims; + +/* Allow the request to proceed when unclaimed pages suffice. */ +if ( requested_pages <= unclaimed_pages ) +return true; + +/* +* If unclaimed pages are insufficient, only a refcounted domain allocation +* may use claims to cover the shortfall. +*/ +if ( !d || (memflags & MEMF_no_refcount) ) +return false; + +/* +* Allow the request to proceed when combination of unclaimed pages and the +* claims held by the domain cover the shortfall for the requested_pages. +*/ +return requested_pages <= unclaimed_pages + d->outstanding_pages; +} + static struct page_info *get_free_buddy(unsigned int zone_lo, unsigned int zone_hi, unsigned int order, unsigned int memflags,
@@ -1017,9 +1053,8 @@ static struct page_info *alloc_heap_pages(* Claimed memory is considered unavailable unless the request * is made by a domain with sufficient unclaimed pages. */ -if ( (outstanding_claims + request > total_avail_pages) && - ((memflags & MEMF_no_refcount) || - !d || d->outstanding_pages < request) ) +if ( !claims_permit_request (d, total_avail_pages, outstanding_claims, + memflags, request) ) {spin_unlock (&heap_lock);return NULL ;
Signature · 1 line
2.39.5
PATCH 3/5 xen/mm: Optimise getting free page counts per NUMA node
In reply to Bernhard KaindlFrom: Alejandro Vallejo <[email protected]>
Introduce per-node free page counters which enhance the efficiency of avail_node_heap_pages():
- It no longer needs to iterate over all zones of a node.
- It is utilised by the numainfo hypercall and the debug-key 'u' to display NUMA information in the printk buffer
- This aggregate will be needed for the node-specific claims feature to determine the number of free pages in a node in the hot path of get_free_buddy() without looping over all zones of a node.
---
Applied Jan's review:
https://lists.xenproject.org/archives/html/xen-devel/2026-03/msg00144.html
Changes:
- Removed accessor macro
- Abandoned conversion to unsigned long
--- xen/common/page_alloc.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-)
xen/common/page_alloc.c +18 -1
@@ -485,7 +485,20 @@ static unsigned long node_need_scrub[MAX_NUMNODES];static unsigned long *avail[MAX_NUMNODES ];static long total_avail_pages; +/* +* Sum of the free pages in all zones of that node. +* Provided via sysctl by NUMA node placement decisions of domain builders and +* for monitoring. It is also logged with debug-key 'u' for NUMA debugging. +*/ +static long node_avail_pages[MAX_NUMNODES ]; +/* +* The global heap lock, protecting access to the heap and related structures. +* It protects the heap and claims of the buddy allocator and d->*claims. +* The locking order is: d->page_alloc_lock (optional) -> heap_lock +* - Numerous external callers holding d->page_alloc_lock call functions +* taking the heap_lock. Note: Violating it would cause an ABBA deadlock. +*/ static DEFINE_SPINLOCK (heap_lock);static long outstanding_claims;/* total outstanding claims by all domains */
@@ -1097,6 +1110,8 @@ static struct page_info *alloc_heap_pages( } } +ASSERT (node_avail_pages[node] >= request); + node_avail_pages[node] -= request;ASSERT (avail[node][zone] >= request); avail[node][zone] -= request; total_avail_pages -= request;
@@ -1287,6 +1302,7 @@ static int reserve_offlined_page(struct page_info *head)if ( !page_state_is (cur_head, offlined) )continue ; + node_avail_pages[node]--; avail[node][zone]--; total_avail_pages--;ASSERT (total_avail_pages >=0 );
@@ -1611,6 +1627,7 @@ static void free_heap_pages( } } + node_avail_pages[node] +=1 << order; avail[node][zone] +=1 << order; total_avail_pages +=1 << order;if ( need_scrub )
@@ -2878,7 +2895,7 @@ unsigned long avail_domheap_pages_region(unsigned long avail_node_heap_pages (unsigned int nodeid) { -return avail_heap_pages (MEMZONE_XEN ,NR_ZONES -1 , nodeid); +return node_avail_pages[nodeid]; }
Signature · 1 line
2.39.5
PATCH 4/5 xen/mm: Split d->outstanding_pages to global_claims & node_claims
In reply to Bernhard KaindlIn preparation for extending claims, rename d->outstanding_pages to d->global_claims to keep the naming easy to reason about with the addition of NUMA node claims.
Add d->node_claims as the aggregate of the domain's node claims for the hot path of the allocator and include it together with d->global_claims when reporting the total claims state of d.
--- xen/common/domctl.c | 2 +- xen/common/page_alloc.c | 33 +++++++++++++++------------------ xen/include/xen/sched.h | 7 +++++-- 3 files changed, 21 insertions(+), 21 deletions(-)
xen/common/domctl.c +1 -1
@@ -97,7 +97,7 @@ void getdomaininfo(struct domain *d, struct xen_domctl_getdomaininfo *info) info->tot_pages =domain_tot_pages (d); info->max_pages = d->max_pages; - info->outstanding_pages = d->outstanding_pages; + info->outstanding_pages = d->global_claims + d->node_claims;#ifdef CONFIG_MEM_SHARING info->shr_pages =atomic_read (&d->shr_pages);#endif
xen/common/page_alloc.c +15 -18
@@ -540,12 +540,12 @@ static unsigned long claims_retire_global(struct domain *d,ASSERT (spin_is_locked (&heap_lock));/* If the withdrawal is larger than the claims, don't withdraw beyond */ - retired =min (d->outstanding_pages +0UL , pages_to_retire); + retired =min (d->global_claims +0UL , pages_to_retire);/* Assert the invariant of outstanding_claims not going negative */ ASSERT (retired <= outstanding_claims); outstanding_claims -= retired; - d->outstanding_pages -= retired; + d->global_claims -= retired;return retired; }
@@ -557,8 +557,7 @@ int domain_set_outstanding_pages(struct domain *d, unsigned long pages)/* * Two locks are needed here: * - d->page_alloc_lock: protects accesses to d->{tot,max,extra}_pages. -* - heap_lock: protects accesses to d->outstanding_pages, total_avail_pages -* and outstanding_claims. +* - heap_lock: Protects accesses to the claims and avail_pages state. */ nrspin_lock (&d->page_alloc_lock);spin_lock (&heap_lock);
@@ -566,13 +565,13 @@ int domain_set_outstanding_pages(struct domain *d, unsigned long pages)/* pages==0 means "unset" the claim. */ if ( pages ==0 ) { -claims_retire_global (d, d->outstanding_pages); +claims_retire_global (d, d->global_claims); ret =0 ; goto out; } -/* only one active claim per domain please */ -if ( d->outstanding_pages ) +/* Reject updating global claims and we can't update node claims */ +if ( d->global_claims || d->node_claims ) { ret = -EINVAL ; goto out;
@@ -599,8 +598,8 @@ int domain_set_outstanding_pages(struct domain *d, unsigned long pages) goto out;/* yay, claim fits in available memory, stake the claim, success! */ - d->outstanding_pages = claim; - outstanding_claims += d->outstanding_pages; + d->global_claims = claim; + outstanding_claims += claim; ret =0 ; out:
@@ -896,7 +895,7 @@ static bool claims_permit_request(const struct domain *d,unsigned int memflags, unsigned long requested_pages) { - unsigned long unclaimed_pages; + unsigned long unclaimed_pages, applicable_claims;ASSERT (spin_is_locked (&heap_lock));ASSERT (avail_pages >= competing_claims);
@@ -919,7 +918,7 @@ static bool claims_permit_request(const struct domain *d,* Allow the request to proceed when combination of unclaimed pages and the * claims held by the domain cover the shortfall for the requested_pages. */ -return requested_pages <= unclaimed_pages + d->outstanding_pages; +return requested_pages <= unclaimed_pages + d->global_claims; } static struct page_info *get_free_buddy(unsigned int zone_lo,
@@ -1067,7 +1066,7 @@ static struct page_info *alloc_heap_pages(* is made by a domain with sufficient unclaimed pages. */ if ( !claims_permit_request (d, total_avail_pages, outstanding_claims, - memflags, request) ) + memflags, request,NUMA_NO_NODE ) ) {spin_unlock (&heap_lock);return NULL ;
@@ -1117,18 +1116,16 @@ static struct page_info *alloc_heap_pages( total_avail_pages -= request;ASSERT (total_avail_pages >=0 ); -if ( d && d->outstanding_pages && !(memflags & MEMF_no_refcount) ) +if ( d && d->global_claims && !(memflags & MEMF_no_refcount) ) {/* * Adjust claims in the same locked region where total_avail_pages is * adjusted, not doing so would lead to a window where the amount of * free memory (avail - claimed) would be incorrect. * -* Note that by adjusting the claimed amount here it's possible for -* pages to fail to be assigned to the claiming domain while already -* having been subtracted from d->outstanding_pages. Such claimed -* amount is then lost, as the pages that fail to be assigned to the -* domain are freed without replenishing the claim. This is fine given +* Note, after retiring claims for the allocation here, assign_pages() +* could fail. The domain looses The retired claims as the not assigned +* pages are freed without replenishing the claim. This is fine given * claims are only to be used during physmap population as part of * domain build, and any failure in assign_pages() there will result in * the domain being destroyed before creation is finished. Losing part
xen/include/xen/sched.h +5 -2
@@ -413,8 +413,11 @@ struct domainunsigned int tot_pages;unsigned int xenheap_pages;/* pages allocated from Xen heap */ -/* Pages claimed but not possessed, protected by global heap_lock. */ -unsigned int outstanding_pages; + +/* All claims are protected by the heap_lock */ +unsigned int global_claims;/* Global Host-level claims */ +unsigned int node_claims;/* Sum of the Node-specific claims */ +unsigned int max_pages;/* maximum value for domain_tot_pages() */ unsigned int extra_pages;/* pages not included in domain_tot_pages() */
Signature · 1 line
2.39.5
PATCH 5/5 xen/mm: Introduce Claim Sets for multiple NUMA nodes
In reply to Bernhard KaindlThis patch extends Xen's memory claim handling to support claim sets spanning multiple NUMA nodes.
Earlier review raised the concern that claims would need to evolve from a single claim into a multi-node model. Roger Pau Monné described the core requirement well:
Quoted 3 lines
Ideally, we would need to introduce a new hypercall that allows making claims from multiple nodes in a single locked region, as to ensure success or failure in an atomic way.
-- Roger Pau Monné
This patch implements that model.
A claim set can contain multiple node-specific claims and an optional global claim for memory that may come from any NUMA node. The new domctl installs the full claim set atomically, and the allocator is updated so that claim checks and claim consumption follow the new semantics.
This patch adds:
1. Atomic installation of multi-node claim sets with a domctl.
2. Allocation-time claim checks.
3. Claim retirement on successful allocation using claims.
4. Retention of the legacy claim interface without functional change.
---
The design document submitted ahead of this series may help with review.
It explains the background, design rationale, and implementation details.
Rendered version:
https://bernhardk-xen-review.readthedocs.io/node-claims-v5/designs/claims/
Posted version:
https://lists.xenproject.org/archives/html/xen-devel/2026-04/msg00108.html
Many thanks to everyone who contributed to the earlier work and review, especially Alejandro Vallejo, Jan Beulich, Andrew Cooper, Roger Pau Monné, Marcus Granado, and Edwin Török.
Many thanks to everyone who contributed to the previous work, reviews, and implementation of this feature.
Thanks,
Bernhard
--- tools/include/xenctrl.h | 4 + tools/libs/ctrl/xc_domain.c | 38 ++++ xen/common/domctl.c | 54 ++++++ xen/common/page_alloc.c | 279 +++++++++++++++++++++++++++- xen/include/public/domctl.h | 32 ++++ xen/include/public/memory.h | 9 + xen/include/xen/mm.h | 3 + xen/include/xen/sched.h | 6 + xen/xsm/flask/hooks.c | 1 + xen/xsm/flask/policy/access_vectors | 1 + 10 files changed, 422 insertions(+), 5 deletions(-)
tools/include/xenctrl.h +4 -0
@@ -2659,6 +2659,10 @@ int xc_domain_set_llc_colors(xc_interface *xch, uint32_t domid,const uint32_t *llc_colors, uint32_t num_llc_colors); +int xc_domain_claim_memory (xc_interface *xch,uint32_t domid, +uint32_t nr_claims, +memory_claim_t *claims); +#if defined(__arm__) || defined(__aarch64__)int xc_dt_overlay (xc_interface *xch,void *overlay_fdt,uint32_t overlay_fdt_size,uint8_t overlay_op);
tools/libs/ctrl/xc_domain.c +38 -0
@@ -1070,6 +1070,44 @@ int xc_domain_remove_from_physmap(xc_interface *xch,return xc_memory_op (xch, XENMEM_remove_from_physmap, &xrfp,sizeof (xrfp)); } +/* Claim the guest memory for a domain before starting the domain build */ +int xc_domain_claim_memory (xc_interface *xch, +uint32_t domid, +uint32_t nr_claims, +memory_claim_t *claims) +{ +struct xen_domctl domctl = {}; +DECLARE_HYPERCALL_BOUNCE (claims,sizeof (*claims) * nr_claims, +XC_HYPERCALL_BUFFER_BOUNCE_IN ); +int ret; + +if (xc_hypercall_bounce_pre (xch, claims) ) +return -1 ; + + domctl.cmd = XEN_DOMCTL_claim_memory; + domctl.domain = domid; + domctl.u.claim_memory.nr_claims = nr_claims; +set_xen_guest_handle (domctl.u.claim_memory.claims, claims); + + ret =do_domctl (xch, &domctl); + +xc_hypercall_bounce_post (xch, claims); + +return ret; +} + +/* +* Legacy API for claiming pages, replaced by xc_domain_claim_memory() +* +* Note: This hypercall is deprecated by xc_domain_claim_memory() +* which provides the same claim semantics described above, and thus can be +* used as drop-in replacement and is extended for NUMA-node-specific claims. +* This hypercall should not be used by new code. +* +* See the following documentation pages for more information: +* docs/guest-guide/dom/DOMCTL_claim_memory.rst +* docs/guest-guide/mem/XENMEM_claim_pages.rst +*/ int xc_domain_claim_pages (xc_interface *xch,uint32_t domid,unsigned long nr_pages)
xen/common/domctl.c +54 -0
66 lines not on this page · raw message
xen/common/page_alloc.c +274 -5
341 lines not on this page · raw message
xen/include/public/domctl.h +32 -0
@@ -1276,6 +1276,36 @@ struct xen_domctl_get_domain_state {uint64_t unique_id;/* Unique domain identifier. */ }; +struct xen_memory_claim { +uint64_aligned_t pages;/* Number of pages to claim */ +uint32_t target;/* Node and/or claim type like legacy or a global claim */ +uint32_t pad;/* Explicit padding: Reserved, initialize to 0 on input */ +}; +typedef struct xen_memory_claim memory_claim_t ; +DEFINE_XEN_GUEST_HANDLE (memory_claim_t); + +/* Special claim targets for the target field of memory_claim_t */ +#define XEN_DOMCTL_CLAIM_MEMORY_LEGACY 0x40000000U/* No node, legacy claim */ +#define XEN_DOMCTL_CLAIM_MEMORY_GLOBAL 0x80000000U/* No node, global claim */ + +/* +* XEN_DOMCTL_claim_memory +* +* Claim memory for a guest domain. It sets aside an amount of memory +* (it is not pre-allocated) for the purpose of satisfying future memory +* allocation requests for building the guest's physical address space. +* Memory can be claimed on a set of nodes, or globally (without node +* affinity), or with legacy behavior. The set of claims is a claim set. See +* docs/guest-guide/dom/DOMCTL_claim_memory.rsti and docs/designs/claims/. +*/ +struct xen_domctl_claim_memory { +/* IN: Array of struct xen_memory_claim */ +XEN_GUEST_HANDLE_64 (memory_claim_t) claims; +/* IN: Number of claims in the claims array handle. */ +uint32_t nr_claims; +uint32_t pad;/* Explicit padding: Reserved, initialize to 0 on input */ +}; +struct xen_domctl {/* Stable domctl ops: interface_version is required to be 0. */ uint32_t cmd;
@@ -1368,6 +1398,7 @@ struct xen_domctl {#define XEN_DOMCTL_gsi_permission 88#define XEN_DOMCTL_set_llc_colors 89#define XEN_DOMCTL_get_domain_state 90/* stable interface */ +#define XEN_DOMCTL_claim_memory 91#define XEN_DOMCTL_gdbsx_guestmemio 1000#define XEN_DOMCTL_gdbsx_pausevcpu 1001#define XEN_DOMCTL_gdbsx_unpausevcpu 1002
@@ -1436,6 +1467,7 @@ struct xen_domctl {#endif struct xen_domctl_set_llc_colors set_llc_colors;struct xen_domctl_get_domain_state get_domain_state; +struct xen_domctl_claim_memory claim_memory;uint8_t pad[128 ]; } u; };
xen/include/public/memory.h +9 -0
@@ -569,6 +569,15 @@ DEFINE_XEN_GUEST_HANDLE(xen_mem_sharing_op_t);* for 10, only 7 additional pages are claimed. * * Caller must be privileged or the hypercall fails. +* +* Note: This hypercall is deprecated by XEN_DOMCTL_claim_memory +* which provides the same claim semantics described above, and thus can be +* used as drop-in replacement and is extended for NUMA-node-specific claims. +* This hypercall should not be used by new code. +* +* See the following documentation pages for more information: +* docs/guest-guide/dom/DOMCTL_claim_memory.rst +* docs/guest-guide/mem/XENMEM_claim_pages.rst */ #define XENMEM_claim_pages 24
xen/include/xen/mm.h +3 -0
@@ -69,6 +69,7 @@#include <xen/list.h> #include <xen/spinlock.h> #include <xen/perfc.h> +#include <public/domctl.h> #include <public/memory.h> struct page_info ;
@@ -131,6 +132,8 @@ int populate_pt_range(unsigned long virt, unsigned long nr_mfns);/* Claim handling */ unsigned long __must_check domain_adjust_tot_pages (struct domain *d,long pages); +int domain_install_claim_set (struct domain *d,unsigned int nr_claims, +memory_claim_t *claims);int domain_set_outstanding_pages (struct domain *d,unsigned long pages);void get_outstanding_claims (uint64_t *free_pages,uint64_t *outstanding_pages);
xen/include/xen/sched.h +6 -0
@@ -417,6 +417,12 @@ struct domain/* All claims are protected by the heap_lock */ unsigned int global_claims;/* Global Host-level claims */ unsigned int node_claims;/* Sum of the Node-specific claims */ +/* +* struct domain is allocated in a dedicated page with more than enough +* spare capacity. It's efficient to use that page to store the +* per-node claims in it instead allocating a separate array for it. +*/ +unsigned int claims[MAX_NUMNODES ];/* Array of per-NUMA-node claims */ unsigned int max_pages;/* maximum value for domain_tot_pages() */ unsigned int extra_pages;/* pages not included in domain_tot_pages() */
xen/xsm/flask/hooks.c +1 -0
@@ -651,6 +651,7 @@ static int cf_check flask_domctl(struct domain *d, unsigned int cmd,/* These have individual XSM hooks (common/domctl.c) */ case XEN_DOMCTL_getdomaininfo: +case XEN_DOMCTL_claim_memory:case XEN_DOMCTL_scheduler_op:case XEN_DOMCTL_irq_permission:case XEN_DOMCTL_iomem_permission:
xen/xsm/flask/policy/access_vectors +1 -0
@@ -218,6 +218,7 @@ class domain2 # XEN_DOMCTL_scheduler_op with XEN_DOMCTL_SCHEDOP_putinfo setscheduler # XENMEM_claim_pages +# XEN_DOMCTL_claim_memory setclaim # XEN_DOMCTL_cacheflush cacheflush
Signature · 1 line
2.39.5