qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH 6/8] v2: set host node affinity


From: Andre Przywara
Subject: [Qemu-devel] [PATCH 6/8] v2: set host node affinity
Date: Tue, 16 Dec 2008 15:19:18 +0100
User-agent: Thunderbird 2.0.0.14 (X11/20080508)

Signed-off-by: Andre Przywara <address@hidden>

--
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 <address@hidden>
# Date 1229432527 -3600
# Node ID fb76ab5d7200aad227a0819521cf34bc85ecdc4f
# Parent  28e2cf1452bacb7c8fca7154cc259769bd9df79e
add memory pinning to guest memory

diff -r 28e2cf1452ba -r fb76ab5d7200 sysemu.h
--- a/sysemu.h  Tue Dec 16 13:58:50 2008 +0100
+++ b/sysemu.h  Tue Dec 16 14:02:07 2008 +0100
@@ -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];
diff -r 28e2cf1452ba -r fb76ab5d7200 vl.c
--- a/vl.c      Tue Dec 16 13:58:50 2008 +0100
+++ b/vl.c      Tue Dec 16 14:02:07 2008 +0100
@@ -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 **e
         exit(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);
 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]