[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 11/15] block: Call drain callbacks only once
From: |
Kevin Wolf |
Subject: |
Re: [PATCH v2 11/15] block: Call drain callbacks only once |
Date: |
Mon, 28 Nov 2022 13:37:15 +0100 |
Am 25.11.2022 um 15:59 hat Vladimir Sementsov-Ogievskiy geschrieben:
> On 11/18/22 20:41, Kevin Wolf wrote:
> > We only need to call both the BlockDriver's callback and the parent
> > callbacks when going from undrained to drained or vice versa. A second
> > drain section doesn't make a difference for the driver or the parent,
> > they weren't supposed to send new requests before and after the second
> > drain.
> >
> > One thing that gets in the way is the 'ignore_bds_parents' parameter in
> > bdrv_do_drained_begin_quiesce() and bdrv_do_drained_end(): It means that
> > bdrv_drain_all_begin() increases bs->quiesce_counter, but does not
> > quiesce the parent through BdrvChildClass callbacks. If an additional
> > drain section is started now, bs->quiesce_counter will be non-zero, but
> > we would still need to quiesce the parent through BdrvChildClass in
> > order to keep things consistent (and unquiesce it on the matching
> > bdrv_drained_end(), even though the counter would reach 0 yet as long as
>
> would reach -> would NOT reach
>
> if I understand correctly)
Yes, you're right. Thanks for catching it. Fixing this while applying
the series.
Kevin
> > the bdrv_drain_all() section is still active).
> >
> > Instead of keeping track of this, let's just get rid of the parameter.
> > It was introduced in commit 6cd5c9d7b2d as an optimisation so that
> > during bdrv_drain_all(), we wouldn't recursively drain all parents up to
> > the root for each node, resulting in quadratic complexity. As it happens,
> > calling the callbacks only once solves the same problem, so as of this
> > patch, we'll still have O(n) complexity and ignore_bds_parents is not
> > needed any more.
> >
> > This patch only ignores the 'ignore_bds_parents' parameter. It will be
> > removed in a separate patch.
> >
> > Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> > Reviewed-by: Hanna Reitz <hreitz@redhat.com>
>
> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
>
>
>
>
> --
> Best regards,
> Vladimir
>
- [PATCH v2 05/15] block: Inline bdrv_drain_invoke(), (continued)
- [PATCH v2 05/15] block: Inline bdrv_drain_invoke(), Kevin Wolf, 2022/11/18
- [PATCH v2 03/15] block: Revert .bdrv_drained_begin/end to non-coroutine_fn, Kevin Wolf, 2022/11/18
- [PATCH v2 04/15] block: Remove drained_end_counter, Kevin Wolf, 2022/11/18
- [PATCH v2 06/15] block: Fix locking for bdrv_reopen_queue_child(), Kevin Wolf, 2022/11/18
- [PATCH v2 07/15] block: Drain invidual nodes during reopen, Kevin Wolf, 2022/11/18
- [PATCH v2 08/15] block: Don't use subtree drains in bdrv_drop_intermediate(), Kevin Wolf, 2022/11/18
- [PATCH v2 11/15] block: Call drain callbacks only once, Kevin Wolf, 2022/11/18
- [PATCH v2 12/15] block: Remove ignore_bds_parents parameter from drain_begin/end., Kevin Wolf, 2022/11/18
- [PATCH v2 13/15] block: Drop out of coroutine in bdrv_do_drained_begin_quiesce(), Kevin Wolf, 2022/11/18
- [PATCH v2 09/15] stream: Replace subtree drain with a single node drain, Kevin Wolf, 2022/11/18
- [PATCH v2 14/15] block: Don't poll in bdrv_replace_child_noperm(), Kevin Wolf, 2022/11/18
- [PATCH v2 10/15] block: Remove subtree drains, Kevin Wolf, 2022/11/18
- [PATCH v2 15/15] block: Remove poll parameter from bdrv_parent_drained_begin_single(), Kevin Wolf, 2022/11/18