qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: Fam Zheng <famz@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
	qemu-devel@nongnu.org, Benoit Canet <benoit@irqsave.net>
Subject: Re: [Qemu-devel] [PATCH v4 5/5] qemu-iotests: Add 093 for IO throttling
Date: Wed, 27 Aug 2014 09:46:59 +0100	[thread overview]
Message-ID: <20140827084659.GA8280@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <20140827061944.GC2977@T430.nay.redhat.com>

[-- Attachment #1: Type: text/plain, Size: 2584 bytes --]

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 = self.vm.qmp("block_set_io_throttle", conv_keys=False, **limits)
> > > +        self.assert_qmp(result, 'return', {})
> > > +
> > > +        # Set vm clock to a known value
> > > +        ns = 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 = self.blockstats('drive0')
> > > +
> > > +        ns += seconds * nsec_per_sec
> > > +        self.vm.qtest_cmd("clock_step %d" % ns)
> > > +        # wait for a while to let requests take off
> > > +        time.sleep(1)
> > 
> > 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.
> > 
> > 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.
> > 
> > Do you think this can be improved?
> 
> 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 throttling;
> when the check passes, we can't guarantee that "everything is correct". That'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.
> 
> Regarding to disk IO, I've submitted a separate patch, the "null://" protocol,
> 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

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

  reply	other threads:[~2014-08-27  8:47 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-05  8:47 [Qemu-devel] [PATCH v4 0/5] This series adds iotest case for IO throttling Fam Zheng
2014-06-05  8:47 ` [Qemu-devel] [PATCH v4 1/5] qemu-io: Account IO by aio_read and aio_write Fam Zheng
2014-06-05  8:47 ` [Qemu-devel] [PATCH v4 2/5] qtest: Add scripts/qtest/qtest.py Fam Zheng
2014-08-26 13:21   ` Stefan Hajnoczi
2014-08-27  3:12     ` Fam Zheng
2014-06-05  8:47 ` [Qemu-devel] [PATCH v4 3/5] qemu-iotests: Add VM method qtest() to iotests.py Fam Zheng
2014-06-05  8:47 ` [Qemu-devel] [PATCH v4 4/5] qemu-iotests: Allow caller to disable underscore convertion for qmp Fam Zheng
2014-06-05  8:47 ` [Qemu-devel] [PATCH v4 5/5] qemu-iotests: Add 093 for IO throttling Fam Zheng
2014-08-26 13:50   ` Stefan Hajnoczi
2014-08-27  6:19     ` Fam Zheng
2014-08-27  8:46       ` Stefan Hajnoczi [this message]
2014-06-17  2:45 ` [Qemu-devel] [PATCH v4 0/5] This series adds iotest case " Fam Zheng
2014-07-31  7:29   ` Fam Zheng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140827084659.GA8280@stefanha-thinkpad.redhat.com \
    --to=stefanha@redhat.com \
    --cc=benoit@irqsave.net \
    --cc=famz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).