qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Krempa <pkrempa@redhat.com>
To: Igor Mammedov <imammedo@redhat.com>
Cc: qemu-devel@nongnu.org, dgibson@redhat.com
Subject: Re: [Qemu-devel] [RFC PATCH 2/2] numa: Add node_id data in query-hotpluggable-cpus
Date: Fri, 8 Jul 2016 14:04:23 +0200	[thread overview]
Message-ID: <20160708120423.GC78006@andariel.pipo.sk> (raw)
In-Reply-To: <20160708135458.53b8214a@nial.brq.redhat.com>

On Fri, Jul 08, 2016 at 13:54:58 +0200, Igor Mammedov wrote:
> On Thu,  7 Jul 2016 17:17:14 +0200
> Peter Krempa <pkrempa@redhat.com> wrote:
> 
> > Add a helper that looks up the NUMA node for a given CPU and use it to
> > fill the node_id in the PPC and X86 impls of query-hotpluggable-cpus.
> > 
> > Signed-off-by: Peter Krempa <pkrempa@redhat.com>
> > ---
> >  hw/i386/pc.c          |  7 +++++++
> >  hw/ppc/spapr.c        |  8 ++++++--
> >  include/sysemu/numa.h |  1 +
> >  numa.c                | 13 +++++++++++++
> >  4 files changed, 27 insertions(+), 2 deletions(-)
> > 
> > diff --git a/hw/i386/pc.c b/hw/i386/pc.c
> > index 4ba02c4..a0b9507 100644
> > --- a/hw/i386/pc.c
> > +++ b/hw/i386/pc.c
> > @@ -2115,6 +2115,7 @@ static HotpluggableCPUList *pc_query_hotpluggable_cpus(MachineState *machine)
> >      HotpluggableCPUList *head = NULL;
> >      PCMachineState *pcms = PC_MACHINE(machine);
> >      const char *cpu_type;
> > +    int node_id;
> > 
> >      cpu = pcms->possible_cpus->cpus[0].cpu;
> >      assert(cpu); /* BSP is always present */
> > @@ -2138,6 +2139,12 @@ static HotpluggableCPUList *pc_query_hotpluggable_cpus(MachineState *machine)
> >          cpu_props->core_id = topo.core_id;
> >          cpu_props->has_thread_id = true;
> >          cpu_props->thread_id = topo.smt_id;
> > +
> > +        if ((node_id = numa_node_get_by_cpu_index(i)) >= 0) {
> > +            cpu_props->has_node_id = true;
> > +            cpu_props->node_id = node_id;
> > +        }
> I've not included node_id for a reason,
>  "-numa cpus=1,2,3..." looks to me hopelessly broken now but
> I've not came up with an idea how to redo it in nice and clean way yet.
> 
> Alternative could be CLI-less numa configuration, where QEMU is started
> without "-numa cpus" but with "-S" then mgmt could call
> query_hotpluggable_cpus() to get possible CPUs and then
> map them to numa  nodes with a new QMP command using attributes
> it got from query_hotpluggable_cpus().

I think this could work for libvirt. The CPU index we currently expose
in the XML would become just a libvirt internal detail and the new QMP
command would be used to do the setup. Adding some QMP calls during VM
startup is okay.

> it's along the way start QEMU -smp 1,maxcpus=X and then add
> remaining CPUs with device_add after getting properties from
> query_hotpluggable_cpus().

I'm going to use a similar approach even for the hotpluggable cpus so I
can query the data for a new VM. On the other hand I can't make libvirt
use the approach with -smp 1,... all the time since we guarantee that a
XML that worked on a older version will be migratable back to the older
version.

> then at machine_done time we can adjust DT/ACPI data to reflect
> configured mapping.

In such case this series can be dropped since it provides what I need
differently.

Thanks,

Peter

  reply	other threads:[~2016-07-08 12:04 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-07 15:17 [Qemu-devel] [RFC PATCH 0/2] cpu hotplug: Extend data provided by query-hotpluggable-cpus Peter Krempa
2016-07-07 15:17 ` [Qemu-devel] [RFC PATCH 1/2] qapi: Add vcpu id to query-hotpluggable-cpus output Peter Krempa
2016-07-08  2:18   ` David Gibson
2016-07-08 11:40     ` Igor Mammedov
2016-07-11  3:30       ` David Gibson
2016-07-11  8:23         ` Igor Mammedov
2016-07-07 15:17 ` [Qemu-devel] [RFC PATCH 2/2] numa: Add node_id data in query-hotpluggable-cpus Peter Krempa
2016-07-07 16:10   ` Andrew Jones
2016-07-08  2:23   ` David Gibson
2016-07-08  7:46     ` Peter Krempa
2016-07-08 12:06       ` Igor Mammedov
2016-07-08 12:26         ` Peter Krempa
2016-07-12  3:27       ` David Gibson
2016-07-08 11:54   ` Igor Mammedov
2016-07-08 12:04     ` Peter Krempa [this message]
2016-07-08 12:10       ` Igor Mammedov
2016-07-08 12:53         ` Peter Krempa
2016-07-07 15:24 ` [Qemu-devel] [RFC PATCH 0/2] cpu hotplug: Extend data provided by query-hotpluggable-cpus Peter Krempa

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=20160708120423.GC78006@andariel.pipo.sk \
    --to=pkrempa@redhat.com \
    --cc=dgibson@redhat.com \
    --cc=imammedo@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 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).