qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Igor Mammedov <imammedo@redhat.com>
To: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Cc: libvir-list@redhat.com, qemu-devel@nongnu.org,
	"Andreas Färber" <afaerber@suse.de>,
	"Eduardo Habkost" <ehabkost@redhat.com>
Subject: Re: [Qemu-devel] Exposing and calculating CPU APIC IDs (was Re: [RFC 1/3] target-i386: moving registers of vmstate from cpu_exec_init() to x86_cpu_realizefn())
Date: Thu, 13 Feb 2014 10:44:03 +0100	[thread overview]
Message-ID: <20140213104403.7bf30f31@nial.usersys.redhat.com> (raw)
In-Reply-To: <1392272048.31130.21.camel@G08FNSTD131468>

On Thu, 13 Feb 2014 14:14:08 +0800
Chen Fan <chen.fan.fnst@cn.fujitsu.com> wrote:

> On Tue, 2014-01-21 at 11:10 +0100, Andreas Färber wrote:
> > Am 21.01.2014 10:51, schrieb Chen Fan:
> > > On Tue, 2014-01-21 at 10:31 +0100, Igor Mammedov wrote:
> > >> On Tue, 21 Jan 2014 15:12:45 +0800
> > >> Chen Fan <chen.fan.fnst@cn.fujitsu.com> wrote:
> > >>> On Mon, 2014-01-20 at 13:29 +0100, Igor Mammedov wrote:
> > >>>> On Fri, 17 Jan 2014 17:13:55 -0200
> > >>>> Eduardo Habkost <ehabkost@redhat.com> wrote:
> > >>>>> On Wed, Jan 15, 2014 at 03:37:04PM +0100, Igor Mammedov wrote:
> > >>>>>> I recall there were objections to it since APIC ID contains topology
> > >>>>>> information and it's not trivial for user to get it right.
> > >>>>>> The last idea that was discussed to fix it was not expose APIC ID to
> > >>>>>> user but rather introduce QOM hierarchy like:
> > >>>>>>   /machine/node/N/socket/X/core/Y/thread/Z
> > >>>>>> and use it in user interface as a means to specify an arbitrary CPU
> > >>>>>> and let QEMU calculate APIC ID based on this path.
> > >>>>>>
> > >>>>>> But nobody took on implementing it yet.
> > >>>>>
> > >>>>> We're taking so long to get a decent interface implemented, that part of
> > >>>>> me is considering exposing the APIC ID directly like suggested before,
> > >>>>> and requiring libvirt to calculate topology-aware APIC IDs[1] to
> > >>>>> properly implement CPU hotplug (and possibly for other tasks).
> > >>>> If you are speaking about 
> > >>>> 'qemu will core dump with "-smp 254, sockets=2, cores=3, threads=2"'
> > >>>> http://patchwork.ozlabs.org/patch/301272/
> > >>>> bug then it's limitation of ACPI implementation,
> > >>>> I'm going to refactor it to use full APIC ids instead of using bitmap,
> > >>>> so that we won't ever run into issue regardless of cpu supported CPU count.
> > >>>>
> > >>>>>
> > >>>>> Another part of me is hoping that the libvirt developers ask us to
> > >>>>> please not do that, so I can use it as argument against exposing the
> > >>>>> APIC IDs directly the next time we discuss this.  :)
> > >>>>
> > >>>> why not try your  /machine/node/N/socket/X/core/Y/thread/Z idea first.
> > >>>> It will benefit not only cpu hotplug but also '-numa' and topology
> > >>>> description in general.
> > >>>>
> > >>> have there been any plan/model of the idea? Need to add a new option to
> > >>> qemu command?
> > >> I suppose we can start with internal default implementation first.
> > >>
> > >> one way could be
> > >>  1. let machine prebuild empty QOM tree /machine/node/N/socket/X/core/Y/thread/Z
> > >>  2. add node, socket, core, thread properties to CPU and link CPU into respective
> > >>     link created by #1
> > >>  
> > > Thanks, I hope I can take some time to make some patches to implement
> > > it.
> > 
> > Please give us a few hours to reply. :)
> > 
> > /machine/node seems too broad a term to me.
> > You can't prebuild the full tree, you can only prepare the nodes.
> > core[Y]/thread[Z] was previously discussed as syntax.
> > 
> > The important part to decide on will be what is going to be child<> and
> > what link<>. Has anyone played with the Intel Quark platform for
> > instance? (Galileo board or upcoming Edison card) On a regular
> > mainboard, we would have socket[X] as a link<x86_64-cpu>, which might
> > point to a child<cpu> /machine/memory-node[W]/cpu[X]. But if we do so we
> > can't reassign it to another memory node - acceptable? With Quark (or
> > Qseven modules etc.) there would be a container object rather than the
> > /machine itself that has a child<i386-cpu> instead of a link<i386-cpu>.
> > I guess the memory nodes could still be on the /machine though.
> > The other point of discussion between Anthony and me was whether core[Y]
> > should be a link<> or child<>, same for thread. I believe a child<> is
> > better as it enforces that unrealizing the CPU will unrealize all its
> > cores and all its threads in the future.
> > 
> > More issues may pop up when thinking about it longer than a few minutes.
> > But yes, we need to start investigating this, and so far I had other
> > priorities like getting the CPUState mess I created cleaned up.
> Hi, Igor, Andreas,
> 
>   In addition, I want to know what way user could use to specify an
> arbitrary CPU if using /machine/node/N/socket/X/core/Y/thread/Z idea? 
> -device qemu64,socket=X,core=Y,thread=Z? or add a new optional command
> line?
Definitely not another CLU option.
I see a couple of options,
 1. as you suggest with additional 'numa=N' so that QEMU could know
    where to attach a new CPU.
 2. add 'parent' like option tied to link<cpu> property and specify full QOM path
    on CLI: -device cpufoo,parent=/machine/node[N]/socket[X]/...


> Thanks,
> Chen
> 
> > 
> > Regards,
> > Andreas
> > 
> 
> 

  reply	other threads:[~2014-02-13  9:44 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-14  9:27 [Qemu-devel] [RFC 0/3] fix migration issues after hotplug a discontinuous cpuid Chen Fan
2014-01-14  9:27 ` [Qemu-devel] [RFC 1/3] target-i386: moving registers of vmstate from cpu_exec_init() to x86_cpu_realizefn() Chen Fan
2014-01-14 10:40   ` Igor Mammedov
2014-01-15 12:24     ` Chen Fan
2014-01-15 14:37       ` Igor Mammedov
2014-01-17 19:13         ` [Qemu-devel] Exposing and calculating CPU APIC IDs (was Re: [RFC 1/3] target-i386: moving registers of vmstate from cpu_exec_init() to x86_cpu_realizefn()) Eduardo Habkost
2014-01-20 12:29           ` Igor Mammedov
2014-01-21  7:12             ` Chen Fan
2014-01-21  9:31               ` Igor Mammedov
2014-01-21  9:51                 ` Chen Fan
2014-01-21 10:10                   ` Andreas Färber
2014-02-13  6:14                     ` Chen Fan
2014-02-13  9:44                       ` Igor Mammedov [this message]
2014-02-17 10:24                         ` Chen Fan
2014-02-17 10:43                           ` Igor Mammedov
2014-02-25  9:07                             ` [Qemu-devel] [PATCH 0/2][RFC] prebuild cpu QOM tree /machine/node/socket/core/thread/ Chen Fan
2014-02-25  9:07                               ` [Qemu-devel] [PATCH 1/2][RFC] qom: introduce cpu QOM hierarchy tree /machine/node/socket/core/thread/cpu Chen Fan
2014-02-25 13:35                                 ` Eric Blake
2014-02-26  1:05                                   ` Chen Fan
2014-02-26 18:52                                 ` Eduardo Habkost
2014-02-28  2:01                                   ` Chen Fan
2014-03-04 10:50                                     ` [Qemu-devel] [RFC v2 0/2] prebuild cpu QOM tree /machine/node/socket/core/thread/ Chen Fan
2014-03-04 10:50                                       ` [Qemu-devel] [RFC v2 1/2] i386: introduce "struct X86TopoInfo" for saving cpu topology information Chen Fan
2014-03-04 19:35                                         ` Eduardo Habkost
2014-03-05  1:33                                           ` Chen Fan
2014-03-11 10:58                                             ` [Qemu-devel] [RFC v3 0/3] prebuild cpu QOM tree /machine/node/socket/core ->link-cpu chen.fan.fnst
2014-03-11 10:58                                               ` [Qemu-devel] [RFC v3 1/3] cpu: introduce CpuTopoInfo structure for argument simplification chen.fan.fnst
2014-03-11 17:10                                                 ` Eduardo Habkost
2014-03-11 10:58                                               ` [Qemu-devel] [RFC v3 2/3] i386: use CpuTopoInfo instead apic_id as argument for pc_new_cpu() chen.fan.fnst
2014-03-11 18:00                                                 ` Eduardo Habkost
2014-03-12  5:53                                                   ` Chen Fan
2014-03-12  7:51                                                   ` [Qemu-devel] [RFC v4 0/3] prebuild cpu QOM tree /machine/node/socket/core ->link-cpu Chen Fan
2014-03-12  7:51                                                     ` [Qemu-devel] [RFC v4 1/3] cpu: introduce CpuTopoInfo structure for argument simplification Chen Fan
2014-03-12 15:36                                                       ` Eduardo Habkost
2014-03-19  8:53                                                         ` [Qemu-devel] [PATCH v1 0/4] prebuild cpu QOM tree /machine/node/socket/core ->link-cpu Chen Fan
2014-03-19  8:53                                                           ` [Qemu-devel] [PATCH v1 1/4] cpu: introduce CpuTopoInfo structure for argument simplification Chen Fan
2014-03-19  8:53                                                           ` [Qemu-devel] [PATCH v1 2/4] i386: use CpuTopoInfo instead apic_id as argument for pc_new_cpu() Chen Fan
2014-03-19 19:27                                                             ` Eduardo Habkost
2014-03-20  6:25                                                               ` Chen Fan
2014-03-19  8:53                                                           ` [Qemu-devel] [PATCH v1 3/4] topo unit-test: update Unit tests to test-x86-cpuid.c Chen Fan
2014-03-19  8:53                                                           ` [Qemu-devel] [PATCH v1 4/4] i386: introduce cpu QOM hierarchy tree Chen Fan
2014-03-19 12:00                                                           ` [Qemu-devel] [PATCH v1 0/4] prebuild cpu QOM tree /machine/node/socket/core ->link-cpu Eric Blake
2014-03-20  0:55                                                             ` Chen Fan
2014-03-12  7:51                                                     ` [Qemu-devel] [RFC v4 2/3] i386: use CpuTopoInfo instead apic_id as argument for pc_new_cpu() Chen Fan
2014-03-12 15:39                                                       ` Eduardo Habkost
2014-03-12  7:51                                                     ` [Qemu-devel] [RFC v4 3/3] i386: introduce cpu QOM hierarchy tree Chen Fan
2014-03-11 10:58                                               ` [Qemu-devel] [RFC v3 " chen.fan.fnst
2014-03-04 10:50                                       ` [Qemu-devel] [RFC v2 2/2] " Chen Fan
2014-02-25  9:07                               ` [Qemu-devel] [PATCH 2/2][RFC] cpu: link each new cpu to QOM tree /machine/node/socket/core/thread/cpu respectively Chen Fan
2014-02-26 19:11                                 ` Eduardo Habkost
2014-02-13 10:00                     ` [Qemu-devel] Exposing and calculating CPU APIC IDs (was Re: [RFC 1/3] target-i386: moving registers of vmstate from cpu_exec_init() to x86_cpu_realizefn()) Igor Mammedov
2014-01-14  9:27 ` [Qemu-devel] [RFC 2/3] target-i386: add -smp X,apics=0x option Chen Fan
2014-02-17 18:37   ` Eric Blake
2014-02-18  1:49     ` Chen Fan
2014-01-14  9:27 ` [Qemu-devel] [RFC 3/3] target-i386: add qmp command 'query-cpus' to display apic_id Chen Fan
2014-02-17 18:37   ` Eric Blake

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=20140213104403.7bf30f31@nial.usersys.redhat.com \
    --to=imammedo@redhat.com \
    --cc=afaerber@suse.de \
    --cc=chen.fan.fnst@cn.fujitsu.com \
    --cc=ehabkost@redhat.com \
    --cc=libvir-list@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).