diff mbox

[v3,10/14] block/io: Quiesce parents between drained_begin/end

Message ID 1462973065-9876-11-git-send-email-kwolf@redhat.com
State New, archived
Headers show

Commit Message

Kevin Wolf May 11, 2016, 1:24 p.m. UTC
So far, bdrv_parent_drained_begin/end() was called for the duration of
the actual bdrv_drain() at the beginning of a drained section, but we
really should keep parents quiesced until the end of the drained
section.

This does not actually change behaviour at this point because the only
user of the .drained_begin/end BdrvChildRole callback is I/O throttling,
which already doesn't send any new requests after flushing its queue in
.drained_being. The patch merely removes a trap for future users.

Reported-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block/io.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Stefan Hajnoczi May 16, 2016, 10:46 p.m. UTC | #1
On Wed, May 11, 2016 at 03:24:21PM +0200, Kevin Wolf wrote:
> So far, bdrv_parent_drained_begin/end() was called for the duration of
> the actual bdrv_drain() at the beginning of a drained section, but we
> really should keep parents quiesced until the end of the drained
> section.
> 
> This does not actually change behaviour at this point because the only
> user of the .drained_begin/end BdrvChildRole callback is I/O throttling,
> which already doesn't send any new requests after flushing its queue in
> .drained_being. The patch merely removes a trap for future users.

s/being/begin/

> 
> Reported-by: Stefan Hajnoczi <stefanha@redhat.com>
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
>  block/io.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/block/io.c b/block/io.c
> index 7c213ec..23abbc5 100644
> --- a/block/io.c
> +++ b/block/io.c
> @@ -2749,11 +2749,14 @@ void bdrv_drained_begin(BlockDriverState *bs)
>      if (!bs->quiesce_counter++) {
>          aio_disable_external(bdrv_get_aio_context(bs));
>      }
> +    bdrv_parent_drained_begin(bs);
>      bdrv_drain(bs);
>  }
>  
>  void bdrv_drained_end(BlockDriverState *bs)
>  {
> +    bdrv_parent_drained_end(bs);
> +
>      assert(bs->quiesce_counter > 0);
>      if (--bs->quiesce_counter > 0) {
>          return;
> -- 
> 1.8.3.1
>
diff mbox

Patch

diff --git a/block/io.c b/block/io.c
index 7c213ec..23abbc5 100644
--- a/block/io.c
+++ b/block/io.c
@@ -2749,11 +2749,14 @@  void bdrv_drained_begin(BlockDriverState *bs)
     if (!bs->quiesce_counter++) {
         aio_disable_external(bdrv_get_aio_context(bs));
     }
+    bdrv_parent_drained_begin(bs);
     bdrv_drain(bs);
 }
 
 void bdrv_drained_end(BlockDriverState *bs)
 {
+    bdrv_parent_drained_end(bs);
+
     assert(bs->quiesce_counter > 0);
     if (--bs->quiesce_counter > 0) {
         return;