All of lore.kernel.org
 help / color / mirror / Atom feed
From: Igor Mammedov <imammedo@redhat.com>
To: "Andreas Färber" <afaerber@suse.de>
Cc: Eduardo Habkost <ehabkost@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH for-2.3] numa: pc: fix default VCPU to node mapping
Date: Wed, 18 Mar 2015 12:05:45 +0100	[thread overview]
Message-ID: <20150318120545.245df0da@nial.brq.redhat.com> (raw)
In-Reply-To: <55085D84.7000701@suse.de>

On Tue, 17 Mar 2015 17:59:48 +0100
Andreas Färber <afaerber@suse.de> wrote:

> Am 17.03.2015 um 17:42 schrieb Eduardo Habkost:
> > On Tue, Mar 17, 2015 at 03:48:38PM +0000, Igor Mammedov wrote:
> >> 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.
> >>
> >> 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.
> >>
> >> For example with following CLI:
> >> qemu-kvm -m 4G -smp 5,sockets=1,cores=4,threads=1,maxcpus=8 \
> >>          -numa node,nodeid=0 -numa node,nodeid=1
> >> 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.
> >>
> >> Replacing default mapping withi 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. cnaging CLI to:
> >>   -numa node,nodeid=0,cpus=0-3 -numa node,nodeid=1,cpus=4-7
> >>
> >> 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.
> >>
> >> Signed-off-by: Igor Mammedov <imammedo@redhat.com>
> > 
> > I believe the proposed behavior is much better. But if we are going to
> > break compatibility, shouldn't we at least do that before the first -rc
> > so we get feedback in case it break existing configurations?
> > 
> > About qemu_cpu_socket_id_from_index(): all qemu-system-* binaries have
> > smp_cores and smp_threads available (even if machines ignore it), but
> > the default stub can return values that are larger than the number of
> > sockets if smp_cores*smp_threads > 1, which would be obviously
> > incorrect. Isn't it easier to simply make
> > "cpu_index/(smp_cores*smp_sockets)" be the default cpu_index->socket
> > mapping function, and allow machine-specific (not arch-specific)
> > overrides if necessary?
> 
> Agree that the proposed stub solution is not so nice. Can you propose a
> MachineClass based solution instead?
sure

> 
> The example I keep bringing up for x86 is that the Galileo boards or
> even the Minnow boards don't really have sockets, being a SoC.
> 
> Thanks,
> Andreas
> 

  reply	other threads:[~2015-03-18 11:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-17 15:48 [Qemu-devel] [PATCH for-2.3] numa: pc: fix default VCPU to node mapping Igor Mammedov
2015-03-17 16:42 ` Eduardo Habkost
2015-03-17 16:59   ` Andreas Färber
2015-03-18 11:05     ` Igor Mammedov [this message]
2015-03-18 11:04   ` Igor Mammedov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150318120545.245df0da@nial.brq.redhat.com \
    --to=imammedo@redhat.com \
    --cc=afaerber@suse.de \
    --cc=ehabkost@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.