From: Kevin Wolf <kwolf@redhat.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Cc: qemu-block@nongnu.org, eesposit@redhat.com, stefanha@redhat.com,
hreitz@redhat.com, pbonzini@redhat.com, qemu-devel@nongnu.org
Subject: Re: [PATCH 04/13] block: Remove drained_end_counter
Date: Fri, 11 Nov 2022 17:37:29 +0100 [thread overview]
Message-ID: <Y256SRiR61wx2Stc@redhat.com> (raw)
In-Reply-To: <bf93bcbc-a6cd-95ff-dee1-7f7171a5d2de@yandex-team.ru>
Am 09.11.2022 um 15:44 hat Vladimir Sementsov-Ogievskiy geschrieben:
> On 11/8/22 15:37, Kevin Wolf wrote:
> > drained_end_counter is unused now, nobody changes its value any more. It
> > can be removed.
> >
> > In cases where we had two almost identical functions that only differed
> > in whether the caller passes drained_end_counter, or whether they would
> > poll for a local drained_end_counter to reach 0, these become a single
> > function.
> >
> > Signed-off-by: Kevin Wolf <kwolf@redhat.com>
>
> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
>
> [..]
>
> > /* Recursively call BlockDriver.bdrv_drain_begin/end callbacks */
>
> Not about this patch, but what is recursive in bdrv_drain_invoke() ?
Nothing today, but it used to be the case. Looks like I forgot to remove
the comment in commit 7d40d9ef five years ago.
> > -static void bdrv_drain_invoke(BlockDriverState *bs, bool begin,
> > - int *drained_end_counter)
> > +static void bdrv_drain_invoke(BlockDriverState *bs, bool begin)
> > {
> > if (!bs->drv || (begin && !bs->drv->bdrv_drain_begin) ||
> > (!begin && !bs->drv->bdrv_drain_end)) {
>
> [..]
>
> > /**
> > * This function does not poll, nor must any of its recursively called
> > - * functions. The *drained_end_counter pointee will be incremented
> > - * once
>
> Seems that is wrong already after previous commit.. Not critical
I think it's technically correct: We don't schedule background
operations any more, so any statement about them is true. :-)
You're right, it could be updated in the previous commit, but maybe it's
easier to read the patches when you need to verify my claim only in this
patch. As you said, it doesn't matter much anyway, at the end of the
series it's gone.
Kevin
> > for every background operation scheduled, and decremented once
> > - * the operation settles. Therefore, the pointer must remain valid
> > - * until the pointee reaches 0. That implies that whoever sets up the
> > - * pointee has to poll until it is 0.
> > - *
> > - * We use atomic operations to access *drained_end_counter, because
> > - * (1) when called from bdrv_set_aio_context_ignore(), the subgraph of
> > - * @bs may contain nodes in different AioContexts,
> > - * (2) bdrv_drain_all_end() uses the same counter for all nodes,
> > - * regardless of which AioContext they are in.
> > + * functions.
> > */
> > static void bdrv_do_drained_end(BlockDriverState *bs, bool recursive,
> > - BdrvChild *parent, bool ignore_bds_parents,
> > - int *drained_end_counter)
> > + BdrvChild *parent, bool ignore_bds_parents)
> > {
> > BdrvChild *child;
> > int old_quiesce_counter;
> > - assert(drained_end_counter != NULL);
> > -
>
> [..]
>
> --
> Best regards,
> Vladimir
>
next prev parent reply other threads:[~2022-11-11 16:38 UTC|newest]
Thread overview: 61+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-08 12:37 [PATCH 00/13] block: Simplify drain Kevin Wolf
2022-11-08 12:37 ` [PATCH 01/13] qed: Don't yield in bdrv_qed_co_drain_begin() Kevin Wolf
2022-11-09 9:21 ` Vladimir Sementsov-Ogievskiy
2022-11-09 9:27 ` Vladimir Sementsov-Ogievskiy
2022-11-09 12:22 ` Kevin Wolf
2022-11-09 21:49 ` Stefan Hajnoczi
2022-11-10 11:07 ` Kevin Wolf
2022-11-11 11:14 ` Emanuele Giuseppe Esposito
2022-11-14 18:16 ` Hanna Reitz
2022-11-08 12:37 ` [PATCH 02/13] test-bdrv-drain: Don't yield in .bdrv_co_drained_begin/end() Kevin Wolf
2022-11-09 10:50 ` Vladimir Sementsov-Ogievskiy
2022-11-09 12:28 ` Kevin Wolf
2022-11-09 13:45 ` Vladimir Sementsov-Ogievskiy
2022-11-11 11:14 ` Emanuele Giuseppe Esposito
2022-11-14 18:16 ` Hanna Reitz
2022-11-08 12:37 ` [PATCH 03/13] block: Revert .bdrv_drained_begin/end to non-coroutine_fn Kevin Wolf
2022-11-09 14:29 ` Vladimir Sementsov-Ogievskiy
2022-11-09 22:13 ` Stefan Hajnoczi
2022-11-11 11:14 ` Emanuele Giuseppe Esposito
2022-11-14 18:17 ` Hanna Reitz
2022-11-08 12:37 ` [PATCH 04/13] block: Remove drained_end_counter Kevin Wolf
2022-11-09 14:44 ` Vladimir Sementsov-Ogievskiy
2022-11-11 16:37 ` Kevin Wolf [this message]
2022-11-11 11:15 ` Emanuele Giuseppe Esposito
2022-11-14 18:19 ` Hanna Reitz
2022-11-08 12:37 ` [PATCH 05/13] block: Inline bdrv_drain_invoke() Kevin Wolf
2022-11-09 15:34 ` Vladimir Sementsov-Ogievskiy
2022-11-10 19:48 ` Stefan Hajnoczi
2022-11-11 11:15 ` Emanuele Giuseppe Esposito
2022-11-14 18:19 ` Hanna Reitz
2022-11-08 12:37 ` [PATCH 06/13] block: Drain invidual nodes during reopen Kevin Wolf
2022-11-09 16:00 ` Vladimir Sementsov-Ogievskiy
2022-11-11 16:54 ` Kevin Wolf
2022-11-08 12:37 ` [PATCH 07/13] block: Don't use subtree drains in bdrv_drop_intermediate() Kevin Wolf
2022-11-09 16:18 ` Vladimir Sementsov-Ogievskiy
2022-11-14 18:20 ` Hanna Reitz
2022-11-08 12:37 ` [PATCH 08/13] stream: Replace subtree drain with a single node drain Kevin Wolf
2022-11-09 16:52 ` Vladimir Sementsov-Ogievskiy
2022-11-10 10:16 ` Kevin Wolf
2022-11-10 11:25 ` Vladimir Sementsov-Ogievskiy
2022-11-10 17:27 ` Kevin Wolf
2022-11-14 18:21 ` Hanna Reitz
2022-11-08 12:37 ` [PATCH 09/13] block: Remove subtree drains Kevin Wolf
2022-11-09 17:22 ` Vladimir Sementsov-Ogievskiy
2022-11-14 18:22 ` Hanna Reitz
2022-11-08 12:37 ` [PATCH 10/13] block: Call drain callbacks only once Kevin Wolf
2022-11-09 18:05 ` Vladimir Sementsov-Ogievskiy
2022-11-14 12:32 ` Kevin Wolf
2022-11-09 18:54 ` Vladimir Sementsov-Ogievskiy
2022-11-14 18:23 ` Hanna Reitz
2022-11-08 12:37 ` [PATCH 11/13] block: Remove ignore_bds_parents parameter from drain functions Kevin Wolf
2022-11-09 18:57 ` Vladimir Sementsov-Ogievskiy
2022-11-14 18:23 ` Hanna Reitz
2022-11-08 12:37 ` [PATCH 12/13] block: Don't poll in bdrv_replace_child_noperm() Kevin Wolf
2022-11-11 11:21 ` Emanuele Giuseppe Esposito
2022-11-14 20:22 ` Hanna Reitz
2022-11-17 13:27 ` Kevin Wolf
2022-11-08 12:37 ` [PATCH 13/13] block: Remove poll parameter from bdrv_parent_drained_begin_single() Kevin Wolf
2022-11-14 20:24 ` Hanna Reitz
2022-11-10 20:13 ` [PATCH 00/13] block: Simplify drain Stefan Hajnoczi
2022-11-11 11:23 ` Emanuele Giuseppe Esposito
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=Y256SRiR61wx2Stc@redhat.com \
--to=kwolf@redhat.com \
--cc=eesposit@redhat.com \
--cc=hreitz@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).