From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40591) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCech-0008RV-Jw for qemu-devel@nongnu.org; Mon, 13 Jun 2016 23:02:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bCecg-0006zW-AC for qemu-devel@nongnu.org; Mon, 13 Jun 2016 23:02:39 -0400 Date: Tue, 14 Jun 2016 12:12:16 +1000 From: David Gibson Message-ID: <20160614021216.GI4882@voom.fritz.box> References: <1465580427-13596-1-git-send-email-drjones@redhat.com> <1465580427-13596-8-git-send-email-drjones@redhat.com> <575BB5AB.3010509@redhat.com> <20160612134810.posa6p4wyxhit4yt@hawk.localdomain> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="3U8TY7m7wOx7RL1F" Content-Disposition: inline In-Reply-To: <20160612134810.posa6p4wyxhit4yt@hawk.localdomain> Subject: Re: [Qemu-devel] [PATCH RFC 07/16] qom/cpu: make nr-cores, nr-threads real properties List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andrew Jones Cc: Thomas Huth , qemu-devel@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, peter.maydell@linaro.org, ehabkost@redhat.com, Bharata B Rao , agraf@suse.de, pbonzini@redhat.com, imammedo@redhat.com, dgibson@redhat.com --3U8TY7m7wOx7RL1F Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jun 12, 2016 at 03:48:10PM +0200, Andrew Jones wrote: > On Sat, Jun 11, 2016 at 08:54:35AM +0200, Thomas Huth wrote: > > On 10.06.2016 19:40, Andrew Jones wrote: > > > Signed-off-by: Andrew Jones > > > --- > > > qom/cpu.c | 8 ++++++++ > > > 1 file changed, 8 insertions(+) > > >=20 > > > diff --git a/qom/cpu.c b/qom/cpu.c > > > index 751e992de8823..024cda3eb98c8 100644 > > > --- a/qom/cpu.c > > > +++ b/qom/cpu.c > > > @@ -28,6 +28,7 @@ > > > #include "exec/log.h" > > > #include "qemu/error-report.h" > > > #include "sysemu/sysemu.h" > > > +#include "hw/qdev-properties.h" > > > =20 > > > bool cpu_exists(int64_t id) > > > { > > > @@ -342,6 +343,12 @@ static int64_t cpu_common_get_arch_id(CPUState *= cpu) > > > return cpu->cpu_index; > > > } > > > =20 > > > +static Property cpu_common_properties[] =3D { > > > + DEFINE_PROP_INT32("nr-cores", CPUState, nr_cores, 1), > > > + DEFINE_PROP_INT32("nr-threads", CPUState, nr_threads, 1), > > > + DEFINE_PROP_END_OF_LIST() > > > +}; > >=20 > > Are you aware of the current CPU hotplug discussion that is going on? >=20 > I'm aware of it going on, but haven't been following it. >=20 > > I'm not very involved there, but I think some of these reworks also move > > "nr_threads" into the CPU state already, e.g. see: >=20 > nr_threads (and nr_cores) are already state in CPUState. This patch just > exposes that state via properties. >=20 > >=20 > > https://github.com/dgibson/qemu/commit/9d07719784ecbeebea71 > >=20 > > ... so you might want to check these patches first to see whether you > > can base your rework on them? >=20 > Every cpu, and thus every machine, uses CPUState for its cpus. I'm > not sure every machine will want to use that new abstract core class > though. If they did, then we could indeed use nr_threads from there > instead (and remove it from CPUState), but we'd still need nr_cores > from the abstract cpu package class (CPUState). Hmm. Since the CPUState object represents just a single thread, it seems weird to me that it would have nr_threads and nr_cores information. Exposing those as properties makes that much worse, because it's now ABI, rather than internal detail we can clean up at some future time. --=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 --3U8TY7m7wOx7RL1F Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJXX2f/AAoJEGw4ysog2bOS5j0P/jCBQHMxLkUxmwPo1UpokiaP 9gq/w5tq1dAs/wxQqSZVa02kYkjQ1Qyu/OTuMeqk6CYB2m1/LGO3x6/DDNINdbOC n6EtCfUn/vD1RXk//IbFGKjfMCGwTcJFa0Gd+xn5G9rl7p1yzmFiq2t4iKqtZH1N XLGR21GSYRWC7NZigvcX4uP012013i3JzqUWnskP14ngbeF0lsij9ZlpCjUi2pd3 UzSkFcPsm/srNz+ujUdD5+174Z07NoVE0zOEzbyr4ec4WLQq3x5a2ZUoqgR3isnu 6Zbuo4PWKXKUjgF5kqaHMtG0tNbL/9ynuZH1MzMAUKAgAJy8tuB8wFD0KTsQ8z2z VVN0HTPeuH2IbqEFpNFSVJs67NjdRTfbb/MNBccfjkzoWLgSrH+6ADz0Eu5Pxf/1 5Y4dTbA5EdP9sEp8RIyhl2RyaoEElrPZgvrMof9PMI9vz4gaowblL2ihAfNL+M65 CZnc2KzWq21ObBpys8ECPMR1spLnIvw0MxojK04eB+/tvimgR1IYQ/TlhByl2HW2 jYWx5DQ9ncj7fHeCuJPMeYIP02Gl8cSWTMovWDB/yYL2cuLAReho7L/kGIAcOlis 4p2nikke8j4hbQ93NOKETzzATglyfRfgMzOmadZiQXwXlCi2a25PiAyOGL7GkNIW JT7M/O2OjaDIC1Xk3d2h =kge2 -----END PGP SIGNATURE----- --3U8TY7m7wOx7RL1F--