qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/3] add NUMA support to QEMU
@ 2008-12-11 11:28 Andre Przywara
  0 siblings, 0 replies; only message in thread
From: Andre Przywara @ 2008-12-11 11:28 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: qemu-devel, 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 
<nrnodes>[,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.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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-12-11 11:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-11 11:28 [Qemu-devel] [PATCH 0/3] add NUMA support to QEMU 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).