Received: from eggs.gnu.org ([2001:4830:134:3::10]:60419) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPJYk-0000Ty-BW for qemu-devel@nongnu.org; Mon, 18 Jul 2016 21:10:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bPJYh-0000KK-0P for qemu-devel@nongnu.org; Mon, 18 Jul 2016 21:10:54 -0400 Date: Tue, 19 Jul 2016 11:09:04 +1000 From: David Gibson Message-ID: <20160719010904.GU16769@voom.fritz.box> References: <1468833560-17397-1-git-send-email-david@gibson.dropbear.id.au> <20160718150618.icfohmtdzuhaqorz@andariel.pipo.sk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="+k4Drb7WGefOwc9B" Content-Disposition: inline In-Reply-To: <20160718150618.icfohmtdzuhaqorz@andariel.pipo.sk> Subject: Re: [Qemu-devel] [RFC 0/2] cpu-add compatibility for query-hotpluggable-cpus implementations List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Krempa Cc: imammedo@redhat.com, bharata@linux.vnet.ibm.com, abologna@redhat.com, qemu-ppc@nongnu.org, qemu-devel@nongnu.org, groug@kaod.org --+k4Drb7WGefOwc9B Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jul 18, 2016 at 05:06:18PM +0200, Peter Krempa wrote: > On Mon, Jul 18, 2016 at 19:19:18 +1000, David Gibson wrote: > > I'm not entirely sure if this is a good idea, and if it is whether > > this is a good approach to it. But I'd like to discuss it and see if > > anyone has better ideas. > >=20 > > As you may know we've hit a bunch of complications with cpu_index > > which will impose some limitations with what we can do with the new > > query-hotpluggable-cpus interface, and we've run out of time to > > address these in qemu-2.7. > > > > At the same time we're hitting complications with the fact that the > > new qemu interface requires a new libvirt interface to use properly, > > and that has follow on effects further up the stack. >=20 > The libvirt interface is basically now depending on adding a working > implementation for qemu or a different hypervisor. APIs without > implementation are not accepted upstream. >=20 > It looks like there are the following problems which make the above > hard: >=20 > First of the problem is the missing link between the NUMA topology > (currently confirured via 'cpu id' which is not linked in any way to the > query-hotpluggable-cpus entries). This basically means that I'll have to > re-implement the qemu numbering scheme and hope that it doesn't change > until a better approach is added. I have at least a start on how to fix this in mind, and it's the next thing I'll work on. However, it obviously won't be merged for qemu-2.7. > Secondly from my understanding of the current state it's impossible to > select an arbitrary cpu to hotplug but they need to happen 'in order' of > the cpu id pointed out above (which is not accessible). The grand plan > is to allow adding the cpus in any order. This makes the feature look > like a proof of concept rather than something useful. Alas, yes :(. Again, I have a plan on this, but it's missed the 2.7 window. > The two problems above make this feature hard to implement and hard to > sell to libvirt's upstream. >=20 > > Together this means a bunch more delays to having usable CPU hotplug > > on Power for downstream users, which is unfortunate. >=20 > I'm not in favor of adding upstream hacks for sake of downstream > deadlines. As a rule, I'm not either. But if the hacks are small and isolated enough, I think it can be reasonable. Whether that's the case is what I'm trying to assess here. > > This is an attempt to get something limited working in a shorter time > > frame, by implementing the old cpu-add interface in terms of the new > > interface. Obviously this can't fully exploit the new interface's > > capabilities, but you can do basic in-order cpu hotplug without removal. >=20 > As a side note, cpu-add technically allows out of order usage. Libvirt > didn't use it that way though. Yes, I know. I gather it will break migration though. With this patch out-of-order cpu-add will fail because of the test enforcing in-order device_add. > > To make this work, I need to broaden the semantics of cpu-add: it will > > a single entry from query-hotpluggable-cpus, which means it may add > > multiple vcpus, which the x86 implementation did not previously do. >=20 > See my response to 2/2. If this requires to add -device for the > hotplugged entries when migrating it basically doesn't help at all. It doesn't. But it does require a more complex calculation of how to increase -smp. > > I'm not sure if the intended semantics of cpu-add were ever defined > > well enough to say if this is "wrong" or not. >=20 > For x86 I'll also need to experiment with the combined use of cpu-add > and device_add interfaces. I plan to add a implementation which > basically uses the old API in libvirt but calls the new APIs in qemu if > they were used previously. (We still need to fall back to the old API > for migration compatibility) > > Because of this, I suspect libvirt will still need some work, but I'm > > hoping it might be less that the full new API implementation. >=20 > Mostly as adding a single entry via the interface will result in > multiple entries in query-cpus. Also libvirt's interface takes the > target number of vcpus as argument so any increment that is not > divisible by the thread count needs to be rejected. Yes. --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --+k4Drb7WGefOwc9B Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJXjX2vAAoJEGw4ysog2bOSQpkQAKBx3SMkBkoF2FtTdaWLksJd RkMHQJZgcJHR15yNEEBbWT7dK1UWEFzb2qhGtBVZxn7ghoPAvbt+4l5//OCxk7AE YI1L8fILx0pfMj7kkfFkaZSbRzrus/Ittm7TnAUkQr46o2KJq+2elIVEZR6s/gJZ OhIpkCBushe+0/P66kL2BpaEGs9bu5gmmyI8Q0II9JVy00avEtErwFbxnV7BGpkA oFWCUbj/S7oeUipUjkmBldwg0dsLt3pyBQvBgQ/8acJnSWP8OB5lUsoYJk+7ca9G TrKYk8DKJvNUsp8MBD9dTAnq5NaTIjej4iP+A1g343jrJTQuzrHyiwrDfUshptVi PZQrpuevGjkHkVgSGqIgWJ1Me6K0sQXn0d92tqbB9BCR7fvTEP6JIzCQLqNTPD0n 7KDsW5vmtw/ppWsqKvZlHl/qGliWfrSCTVZ9RWH1ZHiNVZX5Vm1hz9mjizSBXNeX WVGY1V3kvNjCGbXBwpxPyqXpTU7DJV6vpxbDv3JIuRUu4KMqUsrJG1RmxknriStd fq5C9zheyf+DycSIt1J8Qno5iL1ITqx38VLnG7v3ZvMahvTWaCtjdZ3jYCnw25tT DwDlGLq78ifoOpPKTko94gn2v5wfmRlUYH9XeHugtYoimlHpnsdVy2bHYKBJdfVd Vfv3093MfctN8vB7qEND =hNQN -----END PGP SIGNATURE----- --+k4Drb7WGefOwc9B--