From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Bernhard Kaindl <bernhard.kaindl@citrix.com>
Cc: xen-devel@lists.xenproject.org,
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>,
Stefano Stabellini <sstabellini@kernel.org>,
"Daniel P. Smith" <dpsmith@apertussolutions.com>
Subject: Re: [PATCH v4 05/10] xen/domain: Add DOMCTL handler for claiming memory with NUMA awareness
Date: Thu, 5 Mar 2026 13:38:07 +0100 [thread overview]
Message-ID: <aal5L6uuFNW2A5NR@macbook.local> (raw)
In-Reply-To: <b2c94f0c3b41976b2691ce15b9f9a2589370e65a.1772098423.git.bernhard.kaindl@citrix.com>
On Thu, Feb 26, 2026 at 02:29:19PM +0000, Bernhard Kaindl wrote:
> Add a DOMCTL handler for claiming memory with NUMA awareness. It
> rejects claims when LLC coloring (does not support claims) is enabled
> and translates the public constant to the internal NUMA_NO_NODE.
>
> The request is forwarded to domain_set_outstanding_pages() for the
> actual claim processing. The handler uses the same XSM hook as the
> legacy XENMEM_claim_pages hypercall.
>
> While the underlying infrastructure currently supports only a single
> claim, the public hypercall interface is designed to be extensible for
> multiple claims in the future without breaking the API.
>
> Signed-off-by: Bernhard Kaindl <bernhard.kaindl@citrix.com>
> ---
> xen/common/domain.c | 29 ++++++++++++++++++++++++++++
> xen/common/domctl.c | 9 +++++++++
> xen/include/public/domctl.h | 38 +++++++++++++++++++++++++++++++++++++
> xen/include/xen/domain.h | 2 ++
> 4 files changed, 78 insertions(+)
>
> diff --git a/xen/common/domain.c b/xen/common/domain.c
> index e7861259a2b3..ac1b091f5574 100644
> --- a/xen/common/domain.c
> +++ b/xen/common/domain.c
> @@ -268,6 +268,35 @@ int get_domain_state(struct xen_domctl_get_domain_state *info, struct domain *d,
> return rc;
> }
>
> +/* Claim memory for a domain or reset the claim */
> +int claim_memory(struct domain *d, const struct xen_domctl_claim_memory *uinfo)
> +{
> + memory_claim_t claim;
> +
> + /* alloc_color_heap_page() does not handle claims, so reject LLC coloring */
> + if ( llc_coloring_enabled )
> + return -EOPNOTSUPP;
> + /*
> + * We only support single claims at the moment, and if the domain is
> + * dying (d->is_dying is set), its claims have already been released
> + */
> + if ( uinfo->pad || uinfo->nr_claims != 1 || d->is_dying )
Iff we can move forward with this single node claim implementation,
the return code for uinfo->nr_claims != 1 needs to be -EOPNOTSUPP, to
differentiate the hypervisor doesn't support the operation vs there's
an error in the input parameters. That check needs to moved into
the previous if condition.
If the domain is dying we could also return -ESRCH, so that we can
differentiate the different error paths from the return code of the
hypercall.
next prev parent reply other threads:[~2026-03-05 12:38 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-26 14:29 [PATCH v4 0/10] xen: Add NUMA-aware memory claims for domains Bernhard Kaindl
2026-02-26 14:29 ` [PATCH v4 01/10] xen/page_alloc: Extract code for consuming claims into inline function Bernhard Kaindl
2026-03-04 16:20 ` Jan Beulich
2026-03-04 18:04 ` Bernhard Kaindl
2026-03-05 8:21 ` Roger Pau Monné
2026-02-26 14:29 ` [PATCH v4 02/10] xen/page_alloc: Optimize getting per-NUMA-node free page counts Bernhard Kaindl
2026-03-04 16:31 ` Jan Beulich
2026-03-04 18:21 ` Bernhard Kaindl
2026-03-05 7:22 ` Jan Beulich
2026-02-26 14:29 ` [PATCH v4 03/10] xen/page_alloc: Implement NUMA-node-specific claims Bernhard Kaindl
2026-03-05 10:53 ` Jan Beulich
2026-03-05 13:12 ` Bernhard Kaindl
2026-03-05 13:36 ` Jan Beulich
2026-03-05 14:54 ` Bernhard Kaindl
2026-03-05 17:00 ` Jan Beulich
2026-02-26 14:29 ` [PATCH v4 04/10] xen/page_alloc: Consolidate per-node counters into avail[] array Bernhard Kaindl
2026-02-26 14:29 ` [PATCH v4 05/10] xen/domain: Add DOMCTL handler for claiming memory with NUMA awareness Bernhard Kaindl
2026-02-26 21:19 ` Teddy Astie
2026-02-26 23:16 ` Bernhard Kaindl
2026-02-27 9:39 ` Teddy Astie
2026-02-27 18:16 ` Bernhard Kaindl
2026-03-05 11:31 ` Jan Beulich
2026-04-14 15:17 ` Bernhard Kaindl
2026-04-16 6:46 ` Jan Beulich
2026-04-16 23:48 ` Bernhard Kaindl
2026-03-05 12:38 ` Roger Pau Monné [this message]
2026-03-05 12:44 ` Jan Beulich
2026-02-26 14:29 ` [PATCH v4 06/10] xsm/flask: Add XEN_DOMCTL_claim_memory to flask Bernhard Kaindl
2026-03-05 13:42 ` Jan Beulich
2026-02-26 14:29 ` [PATCH v4 07/10] tools/lib/ctrl/xc: Add xc_domain_claim_memory() to libxenctrl Bernhard Kaindl
2026-02-26 14:29 ` [PATCH v4 08/10] tools/ocaml/libs/xc: add OCaml domain_claim_memory binding Bernhard Kaindl
2026-02-26 14:29 ` [PATCH v4 09/10] tools/tests: Update the claims test to test claim_memory hypercall Bernhard Kaindl
2026-02-26 14:29 ` [PATCH v4 10/10] docs/guest-guide: document the memory claim hypercalls Bernhard Kaindl
2026-03-04 16:07 ` [PATCH v4 0/10] xen: Add NUMA-aware memory claims for domains Jan Beulich
2026-03-04 17:27 ` 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=aal5L6uuFNW2A5NR@macbook.local \
--to=roger.pau@citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=anthony.perard@vates.tech \
--cc=bernhard.kaindl@citrix.com \
--cc=dpsmith@apertussolutions.com \
--cc=jbeulich@suse.com \
--cc=julien@xen.org \
--cc=michal.orzel@amd.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.