[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v7 01/13] machine: Don't allow CPU toplogies wit
From: |
Eduardo Habkost |
Subject: |
Re: [Qemu-devel] [PATCH v7 01/13] machine: Don't allow CPU toplogies with partially filled cores |
Date: |
Fri, 29 Jan 2016 13:36:05 -0200 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Fri, Jan 29, 2016 at 04:10:47PM +0100, Igor Mammedov wrote:
> On Fri, 29 Jan 2016 12:24:18 -0200
> Eduardo Habkost <address@hidden> wrote:
>
> > On Fri, Jan 29, 2016 at 02:52:30PM +1100, David Gibson wrote:
> > > On Thu, Jan 28, 2016 at 11:19:43AM +0530, Bharata B Rao wrote:
> > > > Prevent guests from booting with CPU topologies that have partially
> > > > filled CPU cores or can result in partially filled CPU cores after
> > > > CPU hotplug like
> > > >
> > > > -smp 15,sockets=1,cores=4,threads=4,maxcpus=16 or
> > > > -smp 15,sockets=1,cores=4,threads=4,maxcpus=17.
> > > >
> > > > This is enforced by introducing MachineClass::validate_smp_config()
> > > > that gets called from generic SMP parsing code. Machine type versions
> > > > that want to enforce this can define this to the generic version
> > > > provided.
> > > >
> > > > Only sPAPR and PC machine types starting from version 2.6 enforce this
> > > > in
> > > > this patch.
> > > >
> > > > Signed-off-by: Bharata B Rao <address@hidden>
> > >
> > > I've been kind of lost in the back and forth about
> > > threads/cores/sockets.
> > >
> > > What, in the end, is the rationale for allowing partially filled
> > > sockets, but not partially filled cores?
> >
> > I don't think there's a good reason for that (at least for PC).
> >
> > It's easier to relax the requirements later if necessary, than
> > dealing with compatibility issues again when making the code more
> > strict. So I suggest we make validate_smp_config_generic() also
> > check if smp_cpus % (smp_threads * smp_cores) == 0.
>
> that would break exiting setups.
Not if we do that only on newer machine classes.
validate_smp_config_generic() will be used only on *-2.6 and
newer.
>
> Also in case of cpu hotplug this patch will break migration
> as target QEMU might refuse starting with hotplugged CPU thread.
This won't change older machine-types.
But I think you are right: it can break migration on pc-2.6, too.
But: isn't migration already broken when creating other sets of
CPUs that can't represented using -smp?
How exactly would you migrate a machine today, if you run:
$ qemu-system-x86_64 -smp 16,sockets=2,cores=2,threads=2,maxcpus=32
(QMP) cpu-add id=31
>
> Perhaps this check should be enforced per target/machine if
> arch requires it.
It is. Please see the patch. It introduces a validate_smp_config
method.
But we need your input to clarify if
validate_smp_config_generic() is safe for pc-2.6 too.
--
Eduardo
[Qemu-devel] [PATCH v7 04/13] cpu: Don't realize CPU from cpu_generic_init(), Bharata B Rao, 2016/01/28
[Qemu-devel] [PATCH v7 05/13] cpu: Reclaim vCPU objects, Bharata B Rao, 2016/01/28
[Qemu-devel] [PATCH v7 06/13] cpu: Add a sync version of cpu_remove(), Bharata B Rao, 2016/01/28
[Qemu-devel] [PATCH v7 07/13] xics, xics_kvm: Handle CPU unplug correctly, Bharata B Rao, 2016/01/28
[Qemu-devel] [PATCH v7 08/13] target-ppc: Introduce PowerPC specific CPU core device, Bharata B Rao, 2016/01/28
[Qemu-devel] [PATCH v7 10/13] spapr: CPU hotplug support, Bharata B Rao, 2016/01/28