From: Bernhard Kaindl <bernhard.kaindl@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: "Bernhard Kaindl" <bernhard.kaindl@citrix.com>,
"Andrew Cooper" <andrew.cooper3@citrix.com>,
"Anthony PERARD" <anthony.perard@vates.tech>,
"Michal Orzel" <michal.orzel@amd.com>,
"Jan Beulich" <jbeulich@suse.com>,
"Julien Grall" <julien@xen.org>,
"Roger Pau Monné" <roger.pau@citrix.com>,
"Stefano Stabellini" <sstabellini@kernel.org>,
"Juergen Gross" <jgross@suse.com>,
"Daniel P. Smith" <dpsmith@apertussolutions.com>,
"Christian Lindig" <christian.lindig@citrix.com>,
"David Scott" <dave@recoil.org>
Subject: [PATCH v6 0/7] xen/mm: Introduce NUMA-aware claim sets for domains
Date: Tue, 14 Apr 2026 14:15:57 +0100 [thread overview]
Message-ID: <cover.1776172526.git.bernhard.kaindl@citrix.com> (raw)
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:
> 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 submission implements that model, and its design and code have been
validated through the following methods:
1. A suite of host-side integration tests (to be posted shortly), which
can be executed on the build host (e.g., on a developer machine) like
the PDX tests by Roger Pau Monné (make -C tools/tests/pdx run), as
well as the domid and rangeset tests.
2. A comprehensive functional system test suite (with nineteen test
cases), included in this v6 submission. These tests are run using
automated deployment across various machine types and generations
in our labs.
3. A set of high-level functional integration tests and performance
tests, executed as part of end-to-end product deployment validation.
4. Validation in a customer's standardised application performance lab
to confirm their performance expectations. (This testing was done on
predecessor code sharing the same design, with the main difference
being that only single-node claims were supported in the previous
code base.)
The series has been reworked substantially in response to v4 review.
Because of that, it is likely best reviewed as a fresh series rather
than incrementally.
Patch summary:
1. xen/mm: Refactor deducting claims to prepare for 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
6. tools/ocaml/libs/xc: Add OCaml bindings for NUMA-aware claims
7. tools/tests/mem-claim: Add a test suite for the memory claim API
The v2 design document submitted ahead of this series may also help with
review. It explains the background, design rationale, and implementation
details.
Rendered version:
https://bernhard-xen.readthedocs.io/en/claim-sets-v2-design/designs/claims
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.
Changes since v5:
-----------------
- No functional changes for the sum of all commits.
(Adding a new function argument was moved to the commit that needs it.)
- Added a comprehensive test suite for the new hypercall using the
libxenctrl wrapper xc_domain_claim_memory(), based on the test in
tools/tests/mem-claim/test-mem-claim.c for the existing hypercall
API by Andrew Cooper.
- Improved the function names to follow standard naming recommendations.
The added functions are renamed as follows:
* claims_retire_allocation() -> redeem_claims_for_allocation()
- Use "redeem" because it is part of an exchange of claims for memory.
* claims_retire_global() -> deduct_global_claims()
* claims_retire_nodes() -> deduct_node_claims()
- These perform the act of reducing the amount of global/node claims.
* claims_retire_node() -> cancel_all_node_claims()
- Cancel all node claims when needed when the claims are terminated.
* The comments and the design document v2 have been updated accordingly.
Thanks,
Bernhard
Bernhard Kaindl (7):
xen/mm: Refactor claim deduction for later functional changes
xen/mm: Allow free pages to cover a claims shortfall
xen/mm: Optimise getting free page counts per NUMA node
xen/mm: Split outstanding claims into global and node totals
xen/mm: Introduce NUMA-aware memory claim sets
tools/ocaml/libs/xc: Add an OCaml binding for NUMA-aware claims
tools/tests/mem-claim: Add a test suite for the memory claim API
tools/include/xenctrl.h | 4 +
tools/libs/ctrl/xc_domain.c | 38 +
tools/ocaml/libs/xc/xenctrl.ml | 11 +
tools/ocaml/libs/xc/xenctrl.mli | 11 +
tools/ocaml/libs/xc/xenctrl_stubs.c | 47 +
tools/tests/mem-claim/.gitignore | 1 +
tools/tests/mem-claim/Makefile | 17 +-
tools/tests/mem-claim/accounting-1.h | 401 +++++++++
tools/tests/mem-claim/input-phase1.h | 171 ++++
tools/tests/mem-claim/input-phase2.h | 91 ++
tools/tests/mem-claim/libtestclaims.c | 995 ++++++++++++++++++++++
tools/tests/mem-claim/libtestclaims.h | 202 +++++
tools/tests/mem-claim/test-claim-memory.c | 129 +++
xen/common/domctl.c | 56 +-
xen/common/page_alloc.c | 374 +++++++-
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 +
21 files changed, 2573 insertions(+), 34 deletions(-)
create mode 100644 tools/tests/mem-claim/accounting-1.h
create mode 100644 tools/tests/mem-claim/input-phase1.h
create mode 100644 tools/tests/mem-claim/input-phase2.h
create mode 100644 tools/tests/mem-claim/libtestclaims.c
create mode 100644 tools/tests/mem-claim/libtestclaims.h
create mode 100644 tools/tests/mem-claim/test-claim-memory.c
--
2.39.5
next reply other threads:[~2026-04-14 13:18 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-14 13:15 Bernhard Kaindl [this message]
2026-04-14 13:22 ` [PATCH v6 1/7] xen/mm: Refactor claim deduction for later functional changes Bernhard Kaindl
2026-04-22 8:39 ` Jan Beulich
2026-04-22 14:35 ` Bernhard Kaindl
2026-05-04 5:41 ` Jan Beulich
2026-05-05 16:31 ` Bernhard Kaindl
2026-04-22 16:18 ` Bernhard Kaindl
2026-04-14 13:22 ` [PATCH v6 2/7] xen/mm: Allow free pages to cover a claims shortfall Bernhard Kaindl
2026-04-22 12:33 ` Jan Beulich
2026-04-14 13:22 ` [PATCH v6 3/7] xen/mm: Optimise getting free page counts per NUMA node Bernhard Kaindl
2026-04-14 13:22 ` [PATCH v6 4/7] xen/mm: Split outstanding claims into global and node totals Bernhard Kaindl
2026-04-22 12:48 ` Jan Beulich
2026-04-14 13:22 ` [PATCH v6 5/7] xen/mm: Introduce NUMA-aware memory claim sets Bernhard Kaindl
2026-04-14 13:22 ` [PATCH v6 6/7] tools/ocaml/libs/xc: Add an OCaml binding for NUMA-aware claims Bernhard Kaindl
2026-04-14 13:22 ` [PATCH v6 7/7] tools/tests/mem-claim: Add a test suite for the memory claim API Bernhard Kaindl
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1776172526.git.bernhard.kaindl@citrix.com \
--to=bernhard.kaindl@citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=anthony.perard@vates.tech \
--cc=christian.lindig@citrix.com \
--cc=dave@recoil.org \
--cc=dpsmith@apertussolutions.com \
--cc=jbeulich@suse.com \
--cc=jgross@suse.com \
--cc=julien@xen.org \
--cc=michal.orzel@amd.com \
--cc=roger.pau@citrix.com \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.