[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v8 0/8] xen/mm: introduce per-node NUMA memory claims


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx, Baptiste Le Duc <baptiste.le-duc@xxxxxxxxxx>
  • From: Bernhard Kaindl <bernhard.kaindl@xxxxxxxxxx>
  • Date: Tue, 01 Dec 2026 18:29:40 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=C6SjSYjDuuq+jUSVUdtPv7Sw7eEXCwpDFm1+or1uUgQ=; b=i43ZZ0fK1xHnrL90F1dVOXfL6v5B1kjZczNZug4rv3koYpryXf05IITZYOGxqfOHBvVIyCDId5U3vXHBPWNeh9zcXBxfBHtXF5SaAzVz6wF5adq1nYkpGd8OYi5Uxbrvdo1eGPNeJeMpt6VnT72uQZcNG1XObnxROGTQGIjiTO4FcXLDKut7ayT7v7r3SDtTzNcJ6G3shJiuhTRXhN4Pa5YN3eyZtbR5jYXk2l/JfhBXT73wVmWSlLsch3OLG1Dcu9UKl1/VZTG4oS3Y5MLEubc4NHFmf324QY2YZhgDShJ2Xn9y2ubIR8eOV6W2O60OnfgP9ZmmhpgMMssja21vdw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=WuesP/RdeqpFxQJw8Zh5tF8qsA3WVnxgvYtpGvbtzgXEHQgYwgbhvmTfHHRlOeKO4xABtQlSSgsWiJfT86Ym4m+nNLB8diJIIPaAv6CzgG5eCxwWEj+IcL+/Y74Ol2k0J/xDbs5wjKXtZ+r09Fl5DqnLliDrat6bjH5MsmwuO9U8619rA4OsNZjin1EFCVh8hKWuFdhRc5VJ17tquTdNCZhOv8gMA7jYAkY3E8jXjbaObEbAnmHJXMcLTVsv5PFxupYUH9qNrpvHq2fQmY1DSwEliiGf0y0p5M77hZYXtmovi/+xD+OZmbhkZvj1Zv3tSC0BF0VyOsxPGQa5ugF/lw==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-Id:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
  • Authentication-results: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Roger Pau Monné <roger@xxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>, Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>, Community Manager <community.manager@xxxxxxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Bernhard Kaindl <contact@xxxxxxxxxxxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Bernhard Kaindl <bernhard.kaindl@xxxxxxxxxx>
  • Delivery-date: Tue, 01 Dec 2026 17:30:12 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

The page allocator supports domain-scoped claims that allow toolstacks
to reserve a quantity of available memory before populating the guest
physical memory of new domains they are building.

Claims let a domain builder fail early if there is not enough memory,
even when several domain builds run in parallel. A host-wide claim can
still succeed when too little memory is free on a required NUMA node.
Per-node claims let the builder reserve capacity where it is needed.

In the future, also claiming contiguous extents such as superpages
may be desirable, so a new, extensible claims API is needed.

Based on current needs, add domain-scoped, per-node claims to claim
memory capacity on selected nodes with domctls and libxc wrappers:

1. XEN_DOMCTL_set_memory_claims with xc_domain_set_memory_claims()
   - A zero claim count releases the outstanding claims for the domain.

2. XEN_DOMCTL_get_memory_claims with xc_domain_get_memory_claims()
   - Report the domain's outstanding claims by NUMA node and separately
     report any host-wide claim.

Install claims before domain creation completes. The domain builder
should explicitly release any outstanding claims it no longer needs.
Automatic release when domain creation finishes is follow-up work.

The per-patch notes explain the design decisions and address likely
reviewer concerns:
https://xen.kaindl.dev/claims-docs-v8/designs/claims/code-review

The v7 submission:
https://lists.xen.org/archives/html/xen-devel/2026-05/msg00363.html

Summary of changes in v8:

- Split the submission into two groups of 4 patches each:
  - Group 1: Protection, release, redemption and request installation.
    1. xen/mm: protect per-node claims in get_free_buddy()
    2. xen/mm: release per-node claims in domain_set_outstanding_pages()
    3. xen/mm: redeem per-node claims for allocations
    4. xen/mm: add domain_set_claims() for new claim requests
  - Group 2: Handlers and xenctrl wrappers for the set and get paths.
    5. xen/domctl: add XEN_DOMCTL_set_memory_claims
    6. libxc: add xc_domain_set_memory_claims()
    7. xen/domctl: add XEN_DOMCTL_get_memory_claims
    8. libxc: add xc_domain_get_memory_claims()

- Split the domctl into separate set and get domctl paths.
- Convert d->claims[node] to be allocated dynamically when needed.
- Refactor claims installation into small, focused functions.
- Drop support for replacing existing claims; it is not required.
- Omit the change to reserve_offlined_page() in v8:
  The least intrusive guard is to clamp unclaimed pages to be >= 0.
- Use 'per-node claims' instead of 'node-specific claims':
  ('node-specific claims' is outdated terminology from when
   the series only supported a single NUMA node claim.)
- Rename the feature "per-node NUMA memory claims" to match.
- See the individual patches for their change histories.

---
Bernhard Kaindl (8):
      xen/mm: protect per-node claims in get_free_buddy()
      xen/mm: release per-node claims in domain_set_outstanding_pages()
      xen/mm: redeem per-node claims for allocations
      xen/mm: add domain_set_claims() for new claim requests
      xen/domctl: add XEN_DOMCTL_set_memory_claims
      libxc: add xc_domain_set_memory_claims()
      xen/domctl: add XEN_DOMCTL_get_memory_claims
      libxc: add xc_domain_get_memory_claims()

 xen/include/public/domctl.h         |  90 ++++++++++
 xen/xsm/flask/policy/access_vectors |   5 +-
 xen/xsm/flask/hooks.c               |   6 +
 xen/include/xen/mm.h                |  17 ++
 xen/include/xen/sched.h             |   4 +
 xen/common/domctl.c                 |  80 +++++++++
 xen/common/page_alloc.c             | 348 +++++++++++++++++++++++++++++++++++-
 tools/include/xenctrl.h             |  22 +++
 tools/libs/ctrl/xc_domain.c         |  51 ++++++
 CHANGELOG.md                        |   5 +
 10 files changed, 620 insertions(+), 8 deletions(-)
---
base-commit: 2d05921accad21e44de5b68dab0c1606e3ff4872
change-id: 20261130-claims-main-v8-16ef1ce188f6

Best regards,
--  
Bernhard Kaindl <bernhard.kaindl@xxxxxxxxxx>




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.