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

[xen master] xen/percpu: NUMA-position the per-CPU area



commit a20e5908e218d07c293ac8d49fb58f0f3a72125b
Author:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
AuthorDate: Thu Apr 17 09:14:03 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Thu Apr 17 11:59:57 2025 +0100

    xen/percpu: NUMA-position the per-CPU area
    
    This seems to have been quite an oversight in Xen's NUMA support, albeit it
    probably because NUMA was arch-specific at first.
    
    This is unlikely to be useful for CONFIG_SEPARATE_XENHEAP builds, but that's
    only ARM32 right now, and unlikely to be interested in NUMA.
    
    Take the opportunity to sort the includes.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
---
 xen/common/percpu.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/xen/common/percpu.c b/xen/common/percpu.c
index c6ecd95a08..cdd70acbea 100644
--- a/xen/common/percpu.c
+++ b/xen/common/percpu.c
@@ -1,8 +1,9 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
-#include <xen/percpu.h>
 #include <xen/cpu.h>
 #include <xen/init.h>
 #include <xen/mm.h>
+#include <xen/numa.h>
+#include <xen/percpu.h>
 #include <xen/rcupdate.h>
 #include <xen/sections.h>
 
@@ -27,6 +28,8 @@ void __init percpu_init_areas(void)
 
 static int init_percpu_area(unsigned int cpu)
 {
+    nodeid_t node = cpu_to_node(cpu);
+    unsigned int memflags = node != NUMA_NO_NODE ? MEMF_node(node) : 0;
     char *p;
 
     if ( __per_cpu_offset[cpu] != INVALID_PERCPU_AREA )
@@ -34,7 +37,7 @@ static int init_percpu_area(unsigned int cpu)
                ? 0
                : -EBUSY;
 
-    if ( (p = alloc_xenheap_pages(PERCPU_ORDER, 0)) == NULL )
+    if ( (p = alloc_xenheap_pages(PERCPU_ORDER, memflags)) == NULL )
         return -ENOMEM;
 
     memset(p, 0, __per_cpu_data_end - __per_cpu_start);
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

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