Skip to content

xen/xenbus: report a ring's host node only when Xen resolved it - #109

Open
kaniini wants to merge 1 commit into
edera/mainlinefrom
ariadne/eng-225-xenbus-ring-host-node
Open

kaniini wants to merge 1 commit into
edera/mainlinefrom
ariadne/eng-225-xenbus-ring-host-node

Conversation

@kaniini

@kaniini kaniini commented Nov 13, 2026 •

Copy link
Copy Markdown

xenbus_ring_host_node() answered page_to_nid() of the ring's placeholder page for every HVM mapping. That is the foreign frame's host node only when xen_mfn_to_node() resolved it at map time and the placeholders were relocated to match, and nothing recorded whether it had, so the documented NUMA_NO_NODE fallback never happened. Wherever the lookup fails (a driver domain, a hypervisor without XENMEM_get_mfn_pxms, an XSM refusal, CONFIG_XEN_BACKEND_NUMA_AFFINITY=n) the placeholders come from the pool of whichever CPU xenwatch ran on, every ring reported that one node, and netback and blkback hard-pinned every guest's queue kthreads and event-channel IRQs onto it.

The resolved node is now recorded on the mapping, NUMA_NO_NODE when Xen did not say, and xenbus_ring_host_node() looks it up there, as the header comment in include/xen/xenbus.h already promised.

Build coverage:

  • Full vmlinux with the latest linux-kernel-oci x86_64 host.config, no warnings. Note that this config has no CONFIG_SMP, so NUMA and with it XEN_BACKEND_NUMA_AFFINITY are off there and xen_mfn_to_node() is the stub; the fix compiles in that shape but the affinity path is dormant in that kernel.
  • xenbus_client.o, grant-table.o, netback's interface.o and blkback's xenbus.o on an x86_64_defconfig base with NUMA, ACPI_NUMA, ZONE_DEVICE, XEN_UNPOPULATED_ALLOC, XEN_BACKEND_NUMA_AFFINITY, netback and blkback enabled, no warnings. That is the shape in which the change does something.

Not runtime-tested; the symptom shows as every backend kthread's Cpus_allowed_list matching one node on a host where the query fails.

Not changed: the second part of the issue, that the pinned node is derived from a frontend-chosen page and so a guest decides which dom0 vCPUs serve its queues. With this change that is only possible when Xen did resolve the node, which is the feature working as designed. Softening it would mean either a scheduler-side preference the kernel does not offer for kthreads, or a policy on how much one guest may concentrate on a node; that is a design call for a follow-up.

ENG-225

xenbus_ring_host_node() answered page_to_nid() of the ring's placeholder
page for every HVM mapping.  That is the host node of the foreign frame
only when xen_mfn_to_node() resolved it at map time and the placeholders
were relocated to match; nothing recorded whether it had, so the
documented NUMA_NO_NODE fallback never happened.

Wherever the lookup fails, in a driver domain, on a hypervisor without
XENMEM_get_mfn_pxms, under an XSM policy that refuses it, or on a kernel
without CONFIG_XEN_BACKEND_NUMA_AFFINITY, the placeholders come from the
pool of whichever CPU xenwatch ran on, so every ring reported that one
node, and netback and blkback hard-pinned every guest's queue kthreads
and event-channel IRQs onto that node's CPUs.

Record the resolved node on the mapping, NUMA_NO_NODE when Xen did not
say, and have xenbus_ring_host_node() look it up there, as its header
comment already promised.

Signed-off-by: Ariadne Conill <ariadne@ariadne.space>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant