From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LAjiq-000617-4D for qemu-devel@nongnu.org; Thu, 11 Dec 2008 06:28:48 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LAjio-0005zl-37 for qemu-devel@nongnu.org; Thu, 11 Dec 2008 06:28:46 -0500 Received: from [199.232.76.173] (port=52595 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LAjin-0005zC-Ek for qemu-devel@nongnu.org; Thu, 11 Dec 2008 06:28:45 -0500 Received: from outbound-va3.frontbridge.com ([216.32.180.16]:42619 helo=VA3EHSOBE001.bigfish.com) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_ARCFOUR_MD5:16) (Exim 4.60) (envelope-from ) id 1LAjil-00064L-Uk for qemu-devel@nongnu.org; Thu, 11 Dec 2008 06:28:44 -0500 Message-ID: <4940F953.6030000@amd.com> Date: Thu, 11 Dec 2008 12:28:19 +0100 From: Andre Przywara MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH 0/3] add NUMA support to QEMU 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 Hi, the following patches add support for NUMA (Non-Uniform Memory Access) guests in QEMU. Since QEMU lacks real SMP support, this is mostly for debugging or research, but will improve performance in KVM (with additional KVM-only patches). 1/3: The user specifies a NUMA topology on the command line: -numa [,mem:size1[;size2..]][,cpu:cpu1[;cpu2..]][,pin:node1[;node2]] Beside the number of nodes all other arguments are optional, so possible command lines are: -numa 2 /* inject two NUMA nodes into the guest, distribute guest CPUs and memory equally over the two nodes, don't pin the memory to host nodes*/ -smp 4 -numa 3,mem:1536M;768M;768M,cpu:0-1;2;3 /* inject three nodes, distribute the memory and cpu as described: node0: 1536M, CPUs 0,1; node1: 768M, CPU 2; node2: 768M, CPU 3 */ -numa 2,pin:2;* /* inject two nodes, allocate the memory for the first node from the host node 2, the second node has no affinity (all host nodes) */ Please note that ; and * must be escaped on the shell. For now it is not recommended to use host pinning in pure QEMU. 2/3: If libnuma is available (package numactl), QEMU will try to allocate memory from the given nodes (or skip this if no pin: argument is given). The NUMA topology is then pushed via the firmware configuration interface to the BIOS. The missing patch to build the ACPI SRAT table in the BIOS will be sent if the BIOS is updated to the current BOCHS version. 3/3: Add monitor support: info numa will print information about the guest and host NUMA status. The numa command expects the same string as on the command line (described above), only that the number of nodes must be omitted. The memory and guest CPU affinity cannot be changed on the fly, because this information is in a static BIOS table. So the only useful command is to change the pinning: numa pin:0;1 /* will pin the first guest node to host node 0, the second guest node to host node 1 */ numa pin:;* /* will leave the first guest node alone (no changes), the second guest node can allocate from all host nodes */ As there is no SMP host support in QEMU, VCPUs cannot be pinned, this is a KVM-only feature. If this is acceptable please tell me and I will send documentation updates. Comments are welcome. Regards, Andre. 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