qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: "Benoît Canet" <benoit.canet@irqsave.net>
Cc: kwolf@redhat.com, Stefan Hajnoczi <stefanha@gmail.com>,
	qemu-devel@nongnu.org, pbonzini@redhat.com
Subject: Re: [Qemu-devel] [PATCH V7 0/5] Continuous Leaky Bucket Throttling
Date: Fri, 30 Aug 2013 11:53:20 +0200	[thread overview]
Message-ID: <20130830095320.GB15010@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <20130829093719.GC5142@irqsave.net>

On Thu, Aug 29, 2013 at 11:37:20AM +0200, Benoît Canet wrote:
> > 1. We keep modifying the timer in bdrv_io_limits_intercept() on each
> >    request even when it has already been set.  I think we'll set it to
> >    the same absolute timestamp, modulo numerical issues.  Should we
> >    avoid doing this?
> 
> I could check that the timer is not pending before setting it.

Paolo is making timer_pending() very cheap so this sounds good.

> > 
> > 2. bdrv_io_limits_resched() only wakes up requests of the same type
> >    (read/write).  Does this mean that BPS_TOTAL/IOPS_TOTAL requests
> >    will have to wait until the other request type timer expires instead
> >    of piggybacking on request completion?
> > 
> >    Is this a problem?  If no, then why piggyback on request completion
> >    at all since apparently it works fine when we don't wake up the other
> >    request type?
> 
> It only wakes up the same request type to be coherent with the two requests
> queues and two timers strategy.
> The ultimate goal of this is to be able to do:
> block_set_io_throttle virtio1 0 0 0 0 3000 1
> The code can cope with this and do independent throttling for reads and
> writes.

I understand why there are separate queues for r/w requests.  What I'm
getting at is that bdrv_io_limits_resched() in its current form is not
needed:

Resources are refilled as time passes, not by completing requests, so
there should be no need to act when a request completes.
bdrv_io_limits_resched() is not necessary (if it was,
BPS_TOTAL/IOPS_TOTAL wouldn't work since bdrv_io_limits_resched() does
not handle the other request type).

bdrv_io_limits_intercept() should wake the next request after calling
throttle_account() so we can submit as many requests as possible right
away, instead of waiting for the first request to complete before
submitting the next request.

After this change:

1. Submitting a request also kicks queued requests.  We always submit as
   many requests as allowed by the bucket.

2. If we need to wait the timer will wake us up when more resources are
   available.

Stefan

  reply	other threads:[~2013-08-30  9:57 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-28 15:07 [Qemu-devel] [PATCH V7 0/5] Continuous Leaky Bucket Throttling Benoît Canet
2013-08-28 15:07 ` [Qemu-devel] [PATCH V7 1/5] throttle: Add a new throttling API implementing continuous leaky bucket Benoît Canet
2013-08-28 15:07 ` [Qemu-devel] [PATCH V7 2/5] throttle: Add units tests Benoît Canet
2013-08-28 15:07 ` [Qemu-devel] [PATCH V7 3/5] block: Enable the new throttling code in the block layer Benoît Canet
2013-08-28 15:07 ` [Qemu-devel] [PATCH V7 4/5] block: Add support for throttling burst max in QMP and the command line Benoît Canet
2013-08-30 14:28   ` Eric Blake
2013-08-28 15:07 ` [Qemu-devel] [PATCH V7 5/5] block: Add iops_size to do the iops accounting for a given io size Benoît Canet
2013-08-30 14:39   ` Eric Blake
2013-08-29  9:09 ` [Qemu-devel] [PATCH V7 0/5] Continuous Leaky Bucket Throttling Stefan Hajnoczi
2013-08-29  9:37   ` Benoît Canet
2013-08-30  9:53     ` Stefan Hajnoczi [this message]
2013-08-30 10:06       ` Paolo Bonzini
2013-08-30 14:21         ` Stefan Hajnoczi
2013-08-29 18:01   ` Benoît Canet

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=20130830095320.GB15010@stefanha-thinkpad.redhat.com \
    --to=stefanha@redhat.com \
    --cc=benoit.canet@irqsave.net \
    --cc=kwolf@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.com \
    /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).