qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Hanna Reitz <hreitz@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>, qemu-block@nongnu.org
Cc: eesposit@redhat.com, stefanha@redhat.com, pbonzini@redhat.com,
	vsementsov@yandex-team.ru, qemu-devel@nongnu.org
Subject: Re: [PATCH v2 00/15] block: Simplify drain
Date: Thu, 24 Nov 2022 19:26:22 +0100	[thread overview]
Message-ID: <b07eb222-d6c4-3fcc-e485-fe56a06e1cd1@redhat.com> (raw)
In-Reply-To: <20221118174110.55183-1-kwolf@redhat.com>

On 18.11.22 18:40, Kevin Wolf wrote:
> I'm aware that exactly nobody has been looking forward to a series with
> this title, but it has to be. The way drain works means that we need to
> poll in bdrv_replace_child_noperm() and that makes things rather messy
> with Emanuele's multiqueue work because you must not poll while you hold
> the graph lock.
>
> The other reason why it has to be is that drain is way too complex and
> there are too many different cases. Some simplification like this will
> hopefully make it considerably more maintainable. The diffstat probably
> tells something, too.
>
> There are roughly speaking three parts in this series:
>
> 1. Make BlockDriver.bdrv_drained_begin/end() non-coroutine_fn again,
>     which allows us to not poll on bdrv_drained_end() any more.
>
> 2. Remove subtree drains. They are a considerable complication in the
>     whole drain machinery (in particular, they require polling in the
>     BdrvChildClass.attach/detach() callbacks that are called during
>     bdrv_replace_child_noperm()) and none of their users actually has a
>     good reason to use them.
>
> 3. Finally get rid of polling in bdrv_replace_child_noperm() by
>     requiring that the child is already drained by the caller and calling
>     callbacks only once and not again for every nested drain section.
>
> If necessary, a prefix of this series can be merged that covers only the
> first or the first two parts and it would still make sense.
>
> v2:
> - Rebased on master
> - Patch 3: Removed left over _co parts in function names
> - Patch 4: Updated function comments to reflect that we're not polling
>    any more
> - Patch 6 (new): Fix inconsistent AioContext locking for reopen code
> - Patch 9 (was 8): Added comment to clarify when polling is allowed
>    and the graph may change again
> - Patch 11 (was 10):
>    * Reworded some comments and the commit message.
>    * Dropped a now unnecessary assertion that was dropped only in a later
>      patch in v1 of the series.
>    * Changed 'int parent_quiesce_counter' into 'bool quiesced_parent'
> - Patch 12 (was 11): Don't remove ignore_bds_parents from
>    bdrv_drain_poll(), it is actually still a valid optimisation there
>    that makes polling O(n) instead of O(n²)
> - Patch 13 (new): Instead of only removing assert(!qemu_in_coroutine())
>    like in v1 of the series, drop out of coroutine context in
>    bdrv_do_drained_begin_quiesce() just to be sure that we'll never get
>    coroutine surprises in drain code.
> - Patch 14 (was 12): More and reworded comments to make things hopefully
>    a bit clearer

Thanks!

Reviewed-by: Hanna Reitz <hreitz@redhat.com>



  parent reply	other threads:[~2022-11-24 18:27 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-18 17:40 [PATCH v2 00/15] block: Simplify drain Kevin Wolf
2022-11-18 17:40 ` [PATCH v2 01/15] qed: Don't yield in bdrv_qed_co_drain_begin() Kevin Wolf
2022-11-18 17:40 ` [PATCH v2 02/15] test-bdrv-drain: Don't yield in .bdrv_co_drained_begin/end() Kevin Wolf
2022-11-18 17:40 ` [PATCH v2 03/15] block: Revert .bdrv_drained_begin/end to non-coroutine_fn Kevin Wolf
2022-11-18 17:40 ` [PATCH v2 04/15] block: Remove drained_end_counter Kevin Wolf
2022-11-18 17:41 ` [PATCH v2 05/15] block: Inline bdrv_drain_invoke() Kevin Wolf
2022-11-18 17:41 ` [PATCH v2 06/15] block: Fix locking for bdrv_reopen_queue_child() Kevin Wolf
2022-11-25 12:56   ` Vladimir Sementsov-Ogievskiy
2022-11-18 17:41 ` [PATCH v2 07/15] block: Drain invidual nodes during reopen Kevin Wolf
2022-11-25 13:10   ` Vladimir Sementsov-Ogievskiy
2022-11-18 17:41 ` [PATCH v2 08/15] block: Don't use subtree drains in bdrv_drop_intermediate() Kevin Wolf
2022-11-18 17:41 ` [PATCH v2 09/15] stream: Replace subtree drain with a single node drain Kevin Wolf
2022-11-18 17:41 ` [PATCH v2 10/15] block: Remove subtree drains Kevin Wolf
2022-11-18 17:41 ` [PATCH v2 11/15] block: Call drain callbacks only once Kevin Wolf
2022-11-25 14:59   ` Vladimir Sementsov-Ogievskiy
2022-11-28 12:37     ` Kevin Wolf
2022-11-18 17:41 ` [PATCH v2 12/15] block: Remove ignore_bds_parents parameter from drain_begin/end Kevin Wolf
2022-11-25 15:05   ` Vladimir Sementsov-Ogievskiy
2022-11-18 17:41 ` [PATCH v2 13/15] block: Drop out of coroutine in bdrv_do_drained_begin_quiesce() Kevin Wolf
2022-11-25 15:13   ` Vladimir Sementsov-Ogievskiy
2022-11-18 17:41 ` [PATCH v2 14/15] block: Don't poll in bdrv_replace_child_noperm() Kevin Wolf
2022-11-25 16:07   ` Vladimir Sementsov-Ogievskiy
2022-11-28 12:59     ` Kevin Wolf
2022-12-09 16:53   ` Paolo Bonzini
2022-12-12  9:09     ` Paolo Bonzini
2022-12-12 15:57     ` Kevin Wolf
2022-12-12 17:31       ` Paolo Bonzini
2022-11-18 17:41 ` [PATCH v2 15/15] block: Remove poll parameter from bdrv_parent_drained_begin_single() Kevin Wolf
2022-11-25 16:08   ` Vladimir Sementsov-Ogievskiy
2022-11-24 18:26 ` Hanna Reitz [this message]
2022-11-28 13:00 ` [PATCH v2 00/15] block: Simplify drain 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=b07eb222-d6c4-3fcc-e485-fe56a06e1cd1@redhat.com \
    --to=hreitz@redhat.com \
    --cc=eesposit@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=vsementsov@yandex-team.ru \
    /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).