qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: qemu-block@nongnu.org, qemu-devel@nongnu.org, mreitz@redhat.com,
	stefanha@redhat.com, pbonzini@redhat.com
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	[thread overview]
Message-ID: <20160509154246.GD5054@noname.redhat.com> (raw)
In-Reply-To: <20160509131706.GD3372@stefanha-x1.localdomain>

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

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 <kwolf@redhat.com>
> > ---
> >  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

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

  reply	other threads:[~2016-05-09 15:42 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-22 17:42 [Qemu-devel] [PATCH v2 00/13] block: Move I/O throttling to BlockBackend Kevin Wolf
2016-04-22 17:42 ` [Qemu-devel] [PATCH v2 01/13] block: Make sure throttled BDSes always have a BB Kevin Wolf
2016-05-04 12:44   ` Alberto Garcia
2016-04-22 17:42 ` [Qemu-devel] [PATCH v2 02/13] block: Introduce BlockBackendPublic Kevin Wolf
2016-05-04 12:45   ` Alberto Garcia
2016-05-04 14:23   ` Eric Blake
2016-04-22 17:42 ` [Qemu-devel] [PATCH v2 03/13] block: throttle-groups: Use BlockBackend pointers internally Kevin Wolf
2016-05-04 12:51   ` Alberto Garcia
2016-04-22 17:42 ` [Qemu-devel] [PATCH v2 04/13] block: Convert throttle_group_get_name() to BlockBackend Kevin Wolf
2016-05-04 12:52   ` Alberto Garcia
2016-04-22 17:42 ` [Qemu-devel] [PATCH v2 05/13] block: Move throttling fields from BDS to BB Kevin Wolf
2016-05-04 13:36   ` Alberto Garcia
2016-05-09 12:43   ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2016-05-11 12:45     ` Kevin Wolf
2016-05-10 12:36   ` [Qemu-devel] " Alberto Garcia
2016-04-22 17:42 ` [Qemu-devel] [PATCH v2 06/13] block: Move actual I/O throttling to BlockBackend Kevin Wolf
2016-05-04 13:05   ` Alberto Garcia
2016-04-22 17:42 ` [Qemu-devel] [PATCH v2 07/13] block: Move I/O throttling configuration functions " Kevin Wolf
2016-05-04 14:11   ` Alberto Garcia
2016-04-22 17:42 ` [Qemu-devel] [PATCH v2 08/13] block: Introduce BdrvChild.opaque Kevin Wolf
2016-05-06 12:54   ` Alberto Garcia
2016-05-06 13:19     ` Kevin Wolf
2016-05-06 15:13   ` Alberto Garcia
2016-04-22 17:42 ` [Qemu-devel] [PATCH v2 09/13] block: Drain throttling queue with BdrvChild callback Kevin Wolf
2016-05-06 15:13   ` Alberto Garcia
2016-05-09 13:17   ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2016-05-09 15:42     ` Kevin Wolf [this message]
2016-04-22 17:42 ` [Qemu-devel] [PATCH v2 10/13] block: Decouple throttling from BlockDriverState Kevin Wolf
2016-05-10 12:38   ` Alberto Garcia
2016-04-22 17:42 ` [Qemu-devel] [PATCH v2 11/13] block: Remove bdrv_move_feature_fields() Kevin Wolf
2016-05-04 14:14   ` Alberto Garcia
2016-04-22 17:42 ` [Qemu-devel] [PATCH v2 12/13] Revert "block: Forbid I/O throttling on nodes with multiple parents for 2.6" Kevin Wolf
2016-05-09 12:31   ` Alberto Garcia
2016-04-22 17:42 ` [Qemu-devel] [PATCH v2 13/13] block: Don't check throttled reqs in bdrv_requests_pending() Kevin Wolf
2016-05-10 12:20   ` Alberto Garcia
2016-05-11 12:35     ` Kevin Wolf
2016-04-29 10:01 ` [Qemu-devel] [PATCH v2 00/13] block: Move I/O throttling to BlockBackend Kevin Wolf
2016-04-29 11:57   ` Alberto Garcia
2016-05-09 13:21 ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi

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=20160509154246.GD5054@noname.redhat.com \
    --to=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.com \
    --cc=stefanha@redhat.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).