From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55983) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWt1U-0000Ka-Nl for qemu-devel@nongnu.org; Tue, 01 Sep 2015 17:23:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZWt1R-00056K-Kz for qemu-devel@nongnu.org; Tue, 01 Sep 2015 17:23:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38196) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWt1R-00055k-5k for qemu-devel@nongnu.org; Tue, 01 Sep 2015 17:23:17 -0400 References: <1441118763-17510-1-git-send-email-jjherne@linux.vnet.ibm.com> <1441118763-17510-2-git-send-email-jjherne@linux.vnet.ibm.com> From: Eric Blake Message-ID: <55E6173F.5000800@redhat.com> Date: Tue, 1 Sep 2015 15:23:11 -0600 MIME-Version: 1.0 In-Reply-To: <1441118763-17510-2-git-send-email-jjherne@linux.vnet.ibm.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="dpGhPdaaq7U9RJ6NnVSC4SFsXvTSwc1KT" Subject: Re: [Qemu-devel] [PATCH v5 1/5] cpu: Provide vcpu throttling interface List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Jason J. Herne" , afaerber@suse.de, amit.shah@redhat.com, dgilbert@redhat.com, borntraeger@de.ibm.com, quintela@redhat.com, qemu-devel@nongnu.org, pbonzini@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --dpGhPdaaq7U9RJ6NnVSC4SFsXvTSwc1KT Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 09/01/2015 08:45 AM, Jason J. Herne wrote: > Provide a method to throttle guest cpu execution. CPUState is augmented= with > timeout controls and throttle start/stop functions. To throttle the gue= st cpu > the caller simply has to call the throttle set function and provide a p= ercentage > of throttle time. >=20 > Signed-off-by: Jason J. Herne > Reviewed-by: Matthew Rosato > --- > cpus.c | 78 +++++++++++++++++++++++++++++++++++++++++++++++= ++++++++ > include/qom/cpu.h | 43 ++++++++++++++++++++++++++++++ > 2 files changed, 121 insertions(+) >=20 > +/** > + * cpu_throttle_set: > + * @new_throttle_pct: Percent of sleep time to running time. I don't think you mean the ratio of sleep time to running time, as much as sleep time to overall time. That is, 10% should mean "sleep 1ms and run 9ms out of every 10ms total", and not "sleep 1ms after every 10ms run, for 90.9% duty cycle". > + * Valid range is 1 to 99. > + * > + * Throttles all vcpus by forcing them to sleep for the given percenta= ge of > + * time. A throttle_percentage of 50 corresponds to a 50% duty cycle r= oughly. > + * (example: 10ms sleep for every 10ms awake). 50% can be a bit ambiguous (not obvious whether a higher percentage means more sleep or more time awake); it might be better to pick a different number, such as: A throttle_percentage of 25 corresponds to a 75% duty cycle (example: 10ms sleep for every 30ms awake). if the percentage really is [1 - duty cycle] (which I suspect), or: A throttle_percentage of 25 corresponds to a 80% duty cycle (example: 10ms sleep for every 40ms awake). (if I'm wrong, and you really meant percentage of sleep time to running time). --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --dpGhPdaaq7U9RJ6NnVSC4SFsXvTSwc1KT Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJV5hc/AAoJEKeha0olJ0NqDC4H/1ILDUZJw8Q8nHj8Koe+gVag lPthn1YeELeDKdcgmakLR0x2zTXBFFNUGPN/EnFLp+NUmaQKUnJmo1OuFlch0O6s mcqZwBVfdpodWSaP/1FQQDCh9qhWlE4uPj1FWHs1C/BYotcSWJoinAvMj3hCIwxd tdQLo6IDdUW25WGa2fvS6VSpuojgbCwg5GwfWL3/8ZMHYrTrc9yg4EeYCsFQdy8l pLC9ycWwNt5XTvV6/u5fat3WJqBPgTiN9qm9/U9Vm/eNNeQr682VmlkTxXAtgfR2 GKYU0GPhEYRLJjBszXJefPUzzL5pqQ7oND5547tei7i5YkKwt8bKlGflliNVCh8= =JNrs -----END PGP SIGNATURE----- --dpGhPdaaq7U9RJ6NnVSC4SFsXvTSwc1KT--