Received: from eggs.gnu.org ([2001:4830:134:3::10]:43052) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aR1Nn-00053I-FV for qemu-devel@nongnu.org; Wed, 03 Feb 2016 12:38:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aR1Nj-0006Z0-BA for qemu-devel@nongnu.org; Wed, 03 Feb 2016 12:38:23 -0500 Date: Wed, 3 Feb 2016 15:38:09 -0200 From: Eduardo Habkost Message-ID: <20160203173809.GG26314@thinpad.lan.raisama.net> References: <1453960195-15181-1-git-send-email-bharata@linux.vnet.ibm.com> <1453960195-15181-2-git-send-email-bharata@linux.vnet.ibm.com> <20160129035230.GL23043@voom.redhat.com> <20160129142418.GY3869@thinpad.lan.raisama.net> <20160129161047.426c3d8f@nial.brq.redhat.com> <20160129153605.GA3869@thinpad.lan.raisama.net> <20160129175215.5b65f98c@nial.brq.redhat.com> <20160129172412.GB3869@thinpad.lan.raisama.net> <20160201104158.22007bfd@nial.brq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160201104158.22007bfd@nial.brq.redhat.com> Subject: Re: [Qemu-devel] [PATCH v7 01/13] machine: Don't allow CPU toplogies with partially filled cores List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Mammedov Cc: mjrosato@linux.vnet.ibm.com, mdroth@linux.vnet.ibm.com, aik@ozlabs.ru, agraf@suse.de, qemu-devel@nongnu.org, qemu-ppc@nongnu.org, tyreld@linux.vnet.ibm.com, Bharata B Rao , pbonzini@redhat.com, nfont@linux.vnet.ibm.com, afaerber@suse.de, David Gibson On Mon, Feb 01, 2016 at 10:41:58AM +0100, Igor Mammedov wrote: [...] > > > > How exactly would you migrate a machine today, if you do the > > following? > > > > $ qemu-system-x86_64 -smp 8,sockets=2,cores=2,threads=2,maxcpus=16 > > (QMP) cpu-add id=15 > isn't it the same broken topology? > sockets*cores*threads != maxcpus > But if you ask if it's possible to migrate machine with non-sequentially > hotplugged CPUs than answer is no it's not possible with cpu-add. I was asking about migration with non-sequential hotplugged CPUs (e.g. with -smp 8,sockets=4,cores=2,threads=2,maxcpus=16). [...] > > > > > > > > > > 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. > > > it breaks migration as it could prevent target from starting if > > > there is hotplugged CPUs on source side. > > > > It looks like this is a problem only if the machine allows > > hotplug of individual threads. What if we just add this to the > > beginning of validate_smp_config_generic(): > > > > if (mc->hot_add_cpu && max_cpus > smp_cpus) { > It would break migration after hotplugging CPUs upto max_cpus > and then trying to migrate. > > Also when we move x86 to device_add that will regress since > hot_add_cpu() won't be used in that case. > > I think there is not much point enforcing restrictions > in this patch as generic. We should leave hook empty and allow > target to override it. Then SPAPR could enforce it's own limit > on partial cores. Agreed. It looks like we won't get rid of thread-based CPU hotplug in x86 in the foreseable future. -- Eduardo