[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [Qemu-block] [PATCH v2 09/13] block: Drain throttling q
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [Qemu-block] [PATCH v2 09/13] block: Drain throttling queue with BdrvChild callback |
Date: |
Mon, 9 May 2016 17:42:46 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Am 09.05.2016 um 15:17 hat Stefan Hajnoczi geschrieben:
> On Fri, Apr 22, 2016 at 07:42:38PM +0200, Kevin Wolf wrote:
> > This removes the last part of I/O throttling from block/io.c and moves
> > it to the BlockBackend.
> >
> > Instead of having knowledge about throttling inside io.c, we can call a
> > BdrvChild callback .drained_begin/end, which happens to drain the
> > throttled requests for BlockBackend parents.
> >
> > Signed-off-by: Kevin Wolf <address@hidden>
> > ---
> > block/block-backend.c | 32 +++++++++++++++++++++++++++-----
> > block/io.c | 39 ++++++++++++++++++---------------------
> > include/block/block_int.h | 8 +++-----
> > 3 files changed, 48 insertions(+), 31 deletions(-)
>
> I'm confused about the naming. BdrvChildRole.drained_begin/end and
> bdrv_parent_drained_begin/end have nothing to do with
> bdrv_drained_begin()/bdrv_drained_end()?
Hm, you may have a point there. I think we need to add another pair of
calls in bdrv_drained_begin()/bdrv_drained_end().
We just want to call the callbacks as well on a simple bdrv_drain() or
bdrv_drain_all(), so the existing calls should be right.
> If these were callbacks that happened at bdrv_drained_begin/end time
> then I could understand, but that doesn't seem to be the case.
>
> What are the semantics of these callbacks? Maybe we can find a clearer
> name. I think the point is not to "drain" (in the sense of completing
> requests) but simply to restart queued requests?
This is just a different perspective on the same thing, as these
callbacks are always called as part of a bdrv_drain(). Any request that
is restarted is also completed before bdrv_drain() returns.
The intended semantics is that a parent doesn't submit new requests
after returning from .drained_begin() until .drained_end() is called.
The easy implementation for throttling was to simply restart the
requests like the old implementation did.
Kevin
pgpA6segt2ZQC.pgp
Description: PGP signature