qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Max Reitz <mreitz@redhat.com>
To: qemu-block@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
	qemu-devel@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>,
	Max Reitz <mreitz@redhat.com>
Subject: [Qemu-devel] [PATCH 0/4] block: Keep track of parent quiescing
Date: Wed,  5 Jun 2019 18:11:14 +0200	[thread overview]
Message-ID: <20190605161118.14544-1-mreitz@redhat.com> (raw)

We currently do not keep track of how many times a child has quiesced
its parent.  We just guess based on the child’s quiesce_counter.  That
keeps biting us when we try to leave drained sections or detach children
(see e.g. commit 5cb2737e925042e).

I think we need an explicit counter to keep track of how many times a
parent has been quiesced (patch 1).  That just makes the code more
resilient.

Actually, no, we don’t need a counter, we need a boolean.  See patch 2
for the explanation.

Yes, it is a bit weird to introduce a counter first (patch 1) and then
immediately make it a boolean (patch 2).  But I believe this to be the
most logical change set.

(“Our current model relies on counting, so adding an explicit counter
makes sense.  It then turns out that counting is probably not the best
idea, so why not make it a boolean?”)


Max Reitz (4):
  block: Introduce BdrvChild.parent_quiesce_counter
  block: Make @parent_quiesced a bool
  iotests: Add @has_quit to vm.shutdown()
  iotests: Test commit with a filter on the chain

 include/block/block.h      |  9 +++---
 include/block/block_int.h  |  6 ++++
 block.c                    | 18 ++++-------
 block/io.c                 | 61 +++++++++++++++++++++++++++++---------
 tests/test-bdrv-drain.c    | 31 +++++++++++--------
 python/qemu/__init__.py    |  5 ++--
 tests/qemu-iotests/040     | 40 ++++++++++++++++++++++++-
 tests/qemu-iotests/040.out |  4 +--
 tests/qemu-iotests/255     |  2 +-
 9 files changed, 126 insertions(+), 50 deletions(-)

-- 
2.21.0



             reply	other threads:[~2019-06-05 16:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-05 16:11 Max Reitz [this message]
2019-06-05 16:11 ` [Qemu-devel] [PATCH 1/4] block: Introduce BdrvChild.parent_quiesce_counter Max Reitz
2019-06-05 16:11 ` [Qemu-devel] [PATCH 2/4] block: Make @parent_quiesced a bool Max Reitz
2019-06-05 16:11 ` [Qemu-devel] [PATCH 3/4] iotests: Add @has_quit to vm.shutdown() Max Reitz
2019-06-05 16:11 ` [Qemu-devel] [PATCH 4/4] iotests: Test commit with a filter on the chain Max Reitz
2019-06-14 15:25 ` [Qemu-devel] [PATCH 0/4] block: Keep track of parent quiescing Kevin Wolf

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=20190605161118.14544-1-mreitz@redhat.com \
    --to=mreitz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --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).