From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42089) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMYsp-0007FH-0k for qemu-devel@nongnu.org; Wed, 27 Aug 2014 04:47:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XMYsi-0005qk-S3 for qemu-devel@nongnu.org; Wed, 27 Aug 2014 04:47:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:61306) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMYsi-0005qg-K7 for qemu-devel@nongnu.org; Wed, 27 Aug 2014 04:47:04 -0400 Date: Wed, 27 Aug 2014 09:46:59 +0100 From: Stefan Hajnoczi Message-ID: <20140827084659.GA8280@stefanha-thinkpad.redhat.com> References: <1401958066-22118-1-git-send-email-famz@redhat.com> <1401958066-22118-6-git-send-email-famz@redhat.com> <20140826135041.GF11279@stefanha-thinkpad.redhat.com> <20140827061944.GC2977@T430.nay.redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="7JfCtLOvnd9MIVvH" Content-Disposition: inline In-Reply-To: <20140827061944.GC2977@T430.nay.redhat.com> Subject: Re: [Qemu-devel] [PATCH v4 5/5] qemu-iotests: Add 093 for IO throttling List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: Kevin Wolf , qemu-devel@nongnu.org, Benoit Canet --7JfCtLOvnd9MIVvH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Aug 27, 2014 at 02:19:44PM +0800, Fam Zheng wrote: > On Tue, 08/26 14:50, Stefan Hajnoczi wrote: > > On Thu, Jun 05, 2014 at 04:47:46PM +0800, Fam Zheng wrote: > > > + result =3D self.vm.qmp("block_set_io_throttle", conv_keys=3D= False, **limits) > > > + self.assert_qmp(result, 'return', {}) > > > + > > > + # Set vm clock to a known value > > > + ns =3D nsec_per_sec > > > + self.vm.qtest_cmd("clock_step %d" % ns) > > > + > > > + # Append many requests into the throttle queue > > > + # They drain bps_max and iops_max > > > + # The rest requests won't get executed until qtest clock is = driven > > > + for i in range(1000): > > > + self.vm.hmp_qemu_io("drive0", "aio_read -a -q 0 512") > > > + self.vm.hmp_qemu_io("drive0", "aio_write -a -q 0 512") > > > + > > > + start_rd_bytes, start_rd_iops, start_wr_bytes, start_wr_iops= =3D self.blockstats('drive0') > > > + > > > + ns +=3D seconds * nsec_per_sec > > > + self.vm.qtest_cmd("clock_step %d" % ns) > > > + # wait for a while to let requests take off > > > + time.sleep(1) > >=20 > > This is not a reliable testing approach. If the system is under heavy > > load maybe only a few requests completed. We don't know whether that is > > due to I/O throttling or not. > >=20 > > A reliable test would not perform real disk I/O so the test is > > independent of disk/system speed. And it would not use time.sleep(1) to > > "wait" since there is no guarantee that anything happened in the > > meantime. > >=20 > > Do you think this can be improved? >=20 > Throttling only sets the upper limit of IO, this test checks the IO doesn= 't > cross it: when the test fails, something must be wrong with the throttlin= g; > when the check passes, we can't guarantee that "everything is correct". T= hat's > not uncommon across many other test cases we have. The other half is very= hard, > because of host load, etc., which are out of control of this script. >=20 > Regarding to disk IO, I've submitted a separate patch, the "null://" prot= ocol, > which can be used to sidestep the host disk load uncertainty. I can base = this > test on top. If both a fake disk and fake timers are used then the execution is deterministic. I'll take a look at the null:// protocol you have posted. Although I would love this test to be deterministic, I understand it is tricky to achieve that. I'd like to discuss making this deterministic but I'm not opposed to merging the current approach. Stefan --7JfCtLOvnd9MIVvH Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJT/ZsDAAoJEJykq7OBq3PILfcH/RWIM+I4KOZVWNwyUvY/1ENn +fkVAnDKeRYktMCGzzxMyQ4BwvrxlqX+x32z6MWVoL7HRRC9JS9Dl4uWE1QH1NiY I64TcmI8dwwTblLxJyKjQzR8pdUEPiJD/lCOy3YspAOAgOJnayVvTtmEf8syNELw Rn8R/zxXd94YmrkvTFWXVdRkeNi7zUuCFPneHSlSMj1jCQwyYJNYAkPCiBHutGnu 8fy+wcStxEKzCrRHHwFXrz4CdjOtoQykjiJTjSkYGRxRQWUavgMwRSE+da7995uh 5jfsVaTVoJ+7DNTIlc7rrqo6VrAY8mngXTHOqgv7arc0jaJJWetHClhiM7l/Pm0= =pwjy -----END PGP SIGNATURE----- --7JfCtLOvnd9MIVvH--