All of lore.kernel.org
 help / color / mirror / Atom feed
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 v7 0/3] xen/mm: Introduce NUMA-aware memory claim sets
Date: Fri,  8 May 2026 21:27:56 +0100	[thread overview]
Message-ID: <cover.1778272036.git.bernhard.kaindl@citrix.com> (raw)

Xen's existing memory claim interface can account only for a host-wide
amount of memory for a domain. That is not enough for toolstacks that need
to claim memory from particular NUMA nodes before building the domain.

This series extends Xen's memory claim design to support claim sets with
NUMA-node-specific entries. Roger Pau Monné summarized the core design
requirement as:

   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.

A claim set can contain multiple node-specific claims and a host-wide
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 are NUMA-node aware.

The components are:

1. installing multi-node claim sets atomically,
2. protecting claimed pages from other claim requests and allocations, and
3. redeeming claims in a NUMA-aware manner when satisfying allocations
   for domains with claims.

Legacy XENMEM_claim_pages behaviour is preserved; the legacy interface
is deprecated and superseded by XEN_DOMCTL_claim_memory.

This update addresses v6 review comments, refactors claim redemption,
and adds a GET operation for inspecting a domain's claim set.

Only one preparatory patch remains in this version, followed by the main
feature and finally the OCaml bindings.

The updated design document for this series was submitted on May 5:
https://lists.xen.org/archives/html/xen-devel/2026-05/msg00163.html
Rendered version: https://xen.kaindl.dev/claims-v7-design/designs/claims/

The core operational principles have been validated in the following ways:

1. A comprehensive functional system test suite running in Dom0,
   which will follow this submission.

2. A native integration test environment for the Xen page allocator,
   providing a configurable synthetic Xen heap for each test case,
   which will follow this submission as well.

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 application performance lab to confirm
   performance expectations. This was done on predecessor code sharing
   the same design; that earlier code only supported single-node claims.

Best regards,
Bernhard

Changes since v6:
- Incorporated v6 review feedback.
- Restored claim invariants as needed after offlining pages.
- Addressed Jan's point about the ambiguity of the term "global":
   See https://lists.xen.org/archives/html/xen-devel/2026-05/msg00026.html
- Use "host-wide claims", with "host_claims" and "node_claims" as shorthands.

In addition, I adjusted helper names to make the domain scope explicit
and to keep the "release", "set", and "get" operations named consistently:

  * deduct_global_claims()         -> domain_release_host_claims()
  * deduct_node_claims()           -> domain_release_node_claims()
  * domain_set_outstanding_pages() -> domain_set_claim_entries()
  * domain_get_claim_entries() was added.

- The new domain_set_claim_entries() helper also handles the legacy
  XENMEM_claim_pages interface for backward compatibility, replacing
  domain_set_outstanding_pages().

Bernhard Kaindl (3):
  xen/mm: Introduce per-node free page counter
  xen/mm: Introduce NUMA-aware memory claim sets
  tools/ocaml: Add OCaml binding for NUMA claim sets

 tools/include/xenctrl.h             |  11 +
 tools/libs/ctrl/xc_domain.c         |  28 ++
 tools/ocaml/libs/xc/xenctrl.ml      |  10 +
 tools/ocaml/libs/xc/xenctrl.mli     |  10 +
 tools/ocaml/libs/xc/xenctrl_stubs.c |  50 ++++
 xen/common/domain.c                 |   5 +-
 xen/common/domctl.c                 |  57 ++++
 xen/common/memory.c                 |   5 +-
 xen/common/page_alloc.c             | 416 +++++++++++++++++++++++-----
 xen/include/public/domctl.h         |  38 +++
 xen/include/public/memory.h         |   2 +
 xen/include/xen/mm.h                |   6 +-
 xen/include/xen/sched.h             |   4 +
 xen/xsm/flask/hooks.c               |   1 +
 xen/xsm/flask/policy/access_vectors |   1 +
 15 files changed, 570 insertions(+), 74 deletions(-)

-- 
2.39.5



             reply	other threads:[~2026-05-08 20:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-08 20:27 Bernhard Kaindl [this message]
2026-05-08 20:27 ` [PATCH v7 1/3] xen/mm: Introduce per-node free page counter Bernhard Kaindl
2026-06-25 13:04   ` Jan Beulich
2026-05-08 20:27 ` [PATCH v7 2/3] xen/mm: Introduce NUMA-aware memory claim sets Bernhard Kaindl
2026-06-25 13:30   ` Jan Beulich
2026-05-08 20:27 ` [PATCH v7 3/3] tools/ocaml: Add OCaml binding for NUMA " Bernhard Kaindl
2026-05-11  9:39   ` Jan Beulich
2026-05-28  8:37     ` Bernhard Kaindl
2026-06-02  8:10       ` Jan Beulich

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.1778272036.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.