v2: set host node affinity
PATCH 6/8 v2: set host node affinity
Signed-off-by Andre Przywara <[email protected]>
Signature · 9 lines
Andre Przywara AMD-Operating System Research Center (OSRC), Dresden, Germany Tel: +49 351 277-84917 ----to satisfy European Law for business letters: AMD Saxony Limited Liability Company & Co. KG, Wilschdorfer Landstr. 101, 01109 Dresden, Germany Register Court Dresden: HRA 4896, General Partner authorized to represent: AMD Saxony LLC (Wilmington, Delaware, US) General Manager of AMD Saxony LLC: Dr. Hans-R. Deppe, Thomas McCoy
# HG changeset patch
# User Andre Przywara <[email protected]> # Date 1229432527 -3600
# Node ID fb76ab5d7200aad227a0819521cf34bc85ecdc4f # Parent 28e2cf1452bacb7c8fca7154cc259769bd9df79e add memory pinning to guest memory
sysemu.h +5 -0
@@ -93,7 +93,12 @@ extern int usb_enabled;extern int usb_enabled;extern int smp_cpus; +#ifdef CONFIG_NUMA +#include <numa.h> +#define MAX_NODES NUMA_NUM_NODES +#else #define MAX_NODES 64 +#endif extern int numnumanodes;extern uint64_t node_mem[MAX_NODES ];extern uint64_t node_to_cpus[MAX_NODES ];
vl.c +18 -0
@@ -93,6 +93,9 @@#include <linux/ppdev.h> #include <linux/parport.h> +#ifdef CONFIG_NUMA +#include <numa.h> +#endif #endif #ifdef __sun__#include <sys/stat.h>
@@ -5464,6 +5467,21 @@ int main(int argc, char **argv, char **eexit (1 ); } +#ifdef CONFIG_NUMA +if (numnumanodes >0 &&numa_available () !=-1 ) { +unsigned long offset =0 ; +int i; + +for (i =0 ; i < numnumanodes; ++i) { +if (hostnodes[i] != (uint64_t )-1 ) { +numa_tonode_memory (phys_ram_base + offset, node_mem[i], + hostnodes[i] % (numa_max_node () +1 )); + } + offset += node_mem[i]; + } + } +#endif +/* init the dynamic translator */ cpu_exec_init_all (tb_size *1024 *1024 );