From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: [PATCH 0/3] KVM-userspace: add NUMA support for guests Date: Mon, 01 Dec 2008 09:18:04 -0600 Message-ID: <4934002C.7070507@codemonkey.ws> References: <492F1DD9.8030901@amd.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Avi Kivity , kvm@vger.kernel.org To: Andre Przywara Return-path: Received: from mail-qy0-f11.google.com ([209.85.221.11]:51860 "EHLO mail-qy0-f11.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750898AbYLAPSK (ORCPT ); Mon, 1 Dec 2008 10:18:10 -0500 Received: by qyk4 with SMTP id 4so2617528qyk.13 for ; Mon, 01 Dec 2008 07:18:08 -0800 (PST) In-Reply-To: <492F1DD9.8030901@amd.com> Sender: kvm-owner@vger.kernel.org List-ID: Andre Przywara wrote: > Hi, > > this patch series introduces multiple NUMA nodes support within KVM > guests. > This will improve the performance of guests which are bigger than one > node (number of VCPUs and/or amount of memory) and also allows better > balancing by taking better usage of each node's memory. > It also improves the one node case by pinning a guest to this node and > avoiding access of remote memory from one VCPU. Could you please post this to qemu-devel? There's really nothing KVM specific here. > The user (or better: management application) specifies the host nodes > the guest should use: -nodes 2,3 would create a two node guest mapped to > node 2 and 3 on the host. These numbers are handed over to libnuma: > VCPUs are pinned to the nodes and the allocated guest memory is bound to > it's respective node. Since libnuma seems not to be installed > everywhere, the user has to enable this via configure --enable-numa > In the BIOS code an ACPI SRAT table was added, which describes the NUMA > topology to the guest. The number of nodes is communicated via the CMOS > RAM (offset 0x3E). If someone thinks of this as a bad idea, tell me. I think the dependency on libnuma is a bad idea. It's mixing a mechanism (emulating NUMA layout) with a policy (how to do memory/VCPU placement). If you split the NUMA emulation bits into a separate patch series, that has no dependency on the host NUMA topology, I think we look at the existing mechanisms we have to see if they're sufficient to do static placement on NUMA boundaries. vcpu pinning is easy enough, I think the only place we're lacking is memory layout. Note, that's totally independent of the guest's NUMA characteristics though. You may still want half of memory to be pinned between two nodes even if the guest has no SRAT tables. Regards, Anthony Liguori > To take use of the new BIOS, install the iasl compiler > (http://acpica.org/downloads/) and type "make bios" before installing, > so the default BIOS will be replaced with the modified one. > Node over-committing is allowed (-nodes 0,0,0,0), omitting the -nodes > parameter reverts to the old behavior. > > Please apply. > > Regards, > Andre. > > Patch 1/3: introduce a command line parameter > Patch 2/3: allocate guests resources from different host nodes > Patch 3/3: generate an appropriate SRAT ACPI table > > Signed-off-by: Andre Przywara >