From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LCalU-0005M7-3S for qemu-devel@nongnu.org; Tue, 16 Dec 2008 09:19:12 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LCalR-0005Ko-Rn for qemu-devel@nongnu.org; Tue, 16 Dec 2008 09:19:11 -0500 Received: from [199.232.76.173] (port=56117 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LCalR-0005KT-HT for qemu-devel@nongnu.org; Tue, 16 Dec 2008 09:19:09 -0500 Received: from outbound-dub.frontbridge.com ([213.199.154.16]:5789 helo=IE1EHSOBE003.bigfish.com) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_ARCFOUR_MD5:16) (Exim 4.60) (envelope-from ) id 1LCalQ-0006dF-HM for qemu-devel@nongnu.org; Tue, 16 Dec 2008 09:19:09 -0500 Message-ID: <4947B8E6.2050508@amd.com> Date: Tue, 16 Dec 2008 15:19:18 +0100 From: Andre Przywara MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------080901020000070500040903" Subject: [Qemu-devel] [PATCH 6/8] v2: set host node affinity Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: qemu-devel@nongnu.org, Avi Kivity --------------080901020000070500040903 Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Signed-off-by: Andre Przywara -- 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 --------------080901020000070500040903 Content-Type: text/x-patch; name="qemunuma_v2_pin_memory.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="qemunuma_v2_pin_memory.patch" # HG changeset patch # User Andre Przywara # 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 +#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 #include +#ifdef CONFIG_NUMA +#include +#endif #endif #ifdef __sun__ #include @@ -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); --------------080901020000070500040903--