Received: from eggs.gnu.org ([2001:4830:134:3::10]:34651) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYd1Y-0007Cw-AT for qemu-devel@nongnu.org; Thu, 19 Mar 2015 12:10:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YYd1S-00014q-5K for qemu-devel@nongnu.org; Thu, 19 Mar 2015 12:10:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42724) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYd1R-00013r-T2 for qemu-devel@nongnu.org; Thu, 19 Mar 2015 12:10:14 -0400 Date: Thu, 19 Mar 2015 17:10:11 +0100 From: Igor Mammedov Message-ID: <20150319171011.1fff8ede@nial.brq.redhat.com> In-Reply-To: <550AF3B9.3090104@suse.de> References: <1426696705-32472-1-git-send-email-imammedo@redhat.com> <550AF3B9.3090104@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2 for-2.3] numa: pc: fix default VCPU to node mapping List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andreas =?UTF-8?B?RsOkcmJlcg==?= Cc: qemu-devel@nongnu.org, ehabkost@redhat.com On Thu, 19 Mar 2015 17:05:13 +0100 Andreas F=C3=A4rber wrote: > Am 18.03.2015 um 17:38 schrieb Igor Mammedov: > > since commit > > dd0247e0 pc: acpi: mark all possible CPUs as enabled in SRAT > > Linux kernel actually tries to use CPU to Node mapping from > > QEMU provided SRAT table instead of discarding it, and that > > in some cases breaks build_sched_domains() which expects > > sane mapping where cores/threads belonging to the same socket > > are on the same NUMA node. > >=20 > > With current default round-robin mapping of VCPUs to nodes > > guest ends-up with cores/threads belonging to the same socket > > being on different NUMA nodes. > >=20 > > For example with following CLI: > > qemu-kvm -m 4G -smp 5,sockets=3D2,cores=3D4,threads=3D1,maxcpus=3D8 \ > > -numa node,nodeid=3D0 -numa node,nodeid=3D1 > > 2.6.32 based kernels will hang on boot due to incorrectly build > > sched_group-s list in update_sd_lb_stats() > > so comment in QEMU justifying dumb default mapping: > > " > > guest OSes must cope with this anyway, because there are BIOSes > > out there in real machines which also use this scheme. > > " > > isn't really valid. > >=20 > > Replacing default mapping with a manual, where VCPUs belonging to > > the same socket are on the same NUMA node, fixes issue for > > guests which can't handle nonsense topology i.e. changing CLI to: > > -numa node,nodeid=3D0,cpus=3D0-3 -numa node,nodeid=3D1,cpus=3D4-7 > >=20 > > So instead of simply scattering VCPUs around nodes, map > > the same socket VCPUs to the same NUMA node, which is what > > guest would expect from a sane hardware/BIOS. > >=20 > > Signed-off-by: Igor Mammedov > > --- > > v2: > > - add machine callback cpu_index_to_socket_id() and use it > > instead of stub approach > > --- > > hw/i386/pc.c | 9 +++++++++ > > include/hw/boards.h | 5 +++++ > > include/sysemu/numa.h | 3 ++- > > numa.c | 18 +++++++++++++----- > > vl.c | 2 +- > > 5 files changed, 30 insertions(+), 7 deletions(-) >=20 > Looks great to me now, the hook name with _socket_id is perfect, >=20 > Reviewed-by: Andreas F=C3=A4rber >=20 > but can we do that in three steps please? "machine:" adding callback and > default implementation, "numa:" switching to use it and "pc:" overriding > the new callback - not only nicer subjects but easier to cherry-pick and > bisect then. sure >=20 > Regards, > Andreas >=20