From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Gibson Subject: Re: [PATCH 2/2] KVM: PPC: Book3S HV: Implement dynamic micro-threading on POWER8 Date: Wed, 3 Jun 2015 11:29:53 +1000 Message-ID: <20150603012953.GB16245@voom.fritz.box> References: <1432790240-28679-1-git-send-email-paulus@samba.org> <1432790240-28679-3-git-send-email-paulus@samba.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="uQr8t48UFsdbeI+V" Cc: kvm@vger.kernel.org, kvm-ppc@vger.kernel.org, Alexander Graf To: Paul Mackerras Return-path: Received: from ozlabs.org ([103.22.144.67]:53587 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751794AbbFCBbr (ORCPT ); Tue, 2 Jun 2015 21:31:47 -0400 Content-Disposition: inline In-Reply-To: <1432790240-28679-3-git-send-email-paulus@samba.org> Sender: kvm-owner@vger.kernel.org List-ID: --uQr8t48UFsdbeI+V Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 28, 2015 at 03:17:20PM +1000, Paul Mackerras wrote: > This builds on the ability to run more than one vcore on a physical > core by using the micro-threading (split-core) modes of the POWER8 > chip. Previously, only vcores from the same VM could be run together, > and (on POWER8) only if they had just one thread per core. With the > ability to split the core on guest entry and unsplit it on guest exit, > we can run up to 8 vcpu threads from up to 4 different VMs, and we can > run multiple vcores with 2 or 4 vcpus per vcore. >=20 > Dynamic micro-threading is only available if the static configuration > of the cores is whole-core mode (unsplit), and only on POWER8. >=20 > To manage this, we introduce a new kvm_split_mode struct which is > shared across all of the subcores in the core, with a pointer in the > paca on each thread. In addition we extend the core_info struct to > have information on each subcore. When deciding whether to add a > vcore to the set already on the core, we now have two possibilities: > (a) piggyback the vcore onto an existing subcore, or (b) start a new > subcore. >=20 > Currently, when any vcpu needs to exit the guest and switch to host > virtual mode, we interrupt all the threads in all subcores and switch > the core back to whole-core mode. It may be possible in future to > allow some of the subcores to keep executing in the guest while > subcore 0 switches to the host, but that is not implemented in this > patch. >=20 > This adds a module parameter called dynamic_mt_modes which controls > which micro-threading (split-core) modes the code will consider, as a > bitmap. In other words, if it is 0, no micro-threading mode is > considered; if it is 2, only 2-way micro-threading is considered; if > it is 4, only 4-way, and if it is 6, both 2-way and 4-way > micro-threading mode will be considered. The default is 6. >=20 > With this, we now have secondary threads which are the primary thread > for their subcore and therefore need to do the MMU switch. These > threads will need to be started even if they have no vcpu to run, so > we use the vcore pointer in the PACA rather than the vcpu pointer to > trigger them. >=20 > Signed-off-by: Paul Mackerras Reviewed-by: David Gibson --=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 --uQr8t48UFsdbeI+V Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJVbliRAAoJEGw4ysog2bOSKNwQAOZh2hXrZwV+qcyDbnTQtbL5 cyimxLazY0oUktYKlrKIBA3d9tTBLwsONLT0uSTUFKLY+pe+rcgdwtBSo977l57j L5HbDgkanavl/+H+ndtZ6/DHKSQ8ygwgc0x+4Da85pKM4mPQVMtM160G7mOIBllk Adbk0Vme7WWxBbgU7DdpAppa6IN8UzUhwwbyOwfLRXds9l+oVE5mKijU9J+Q2uko 8PSGfWAsuJoqFwVMTXyfnowWtYfwl6BLuNf3ILy2BeNJudkPlmWoLLTogCwpUW/v ElDQ+V/UJm638niLifwKPIzqwKfoWzF0WyRBBEaivrz8m2iXA7vq6whzeu2jrYiA KK2CfzoG3WSME5V4KHsYYnGoK8/nSy+yBnFyWXUL5D/LjQHinc24K0fXtlOQ3XMx +cUpnLDQz32z10D3jfDitQqULU8FVlusV1fF0wclDUSLJD5AMhU0PYYcPqStRU5T O0EVtVnM7RaHZ8umATQXbN5bfsmPOeJ8BaaaVX0LOE43PYxrZrvDiZmgXWO79T/f +ahVsTNcNxRk+J7GBkNPivPlyoqm9IAVLZsDmKa8Hd+9BxSzZhcv42lQvmas7dmY 6gjn51xDr0IMj11HR6ya6s57o3tfeNMNVyCKB3c8jm0MtBxMW16kwH95Y+hr/HN3 6g/eTc69etNyObfYBU41 =ODLu -----END PGP SIGNATURE----- --uQr8t48UFsdbeI+V--