* [Qemu-devel] [PATCH 6/8] v2: set host node affinity
@ 2008-12-16 14:19 Andre Przywara
0 siblings, 0 replies; only message in thread
From: Andre Przywara @ 2008-12-16 14:19 UTC (permalink / raw)
To: Anthony Liguori; +Cc: qemu-devel, Avi Kivity
[-- Attachment #1: Type: text/plain, Size: 491 bytes --]
Signed-off-by: Andre Przywara <andre.przywara@amd.com>
--
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
[-- Attachment #2: qemunuma_v2_pin_memory.patch --]
[-- Type: text/x-patch, Size: 1585 bytes --]
# HG changeset patch
# User Andre Przywara <andre.przywara@amd.com>
# 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);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-12-16 14:19 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-16 14:19 [Qemu-devel] [PATCH 6/8] v2: set host node affinity Andre Przywara
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).