[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 05/12] block: Reduce (un)drains when replacin
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [PATCH v2 05/12] block: Reduce (un)drains when replacing a child |
Date: |
Tue, 16 Jul 2019 19:18:49 +0200 |
User-agent: |
Mutt/1.11.3 (2019-02-01) |
Am 03.07.2019 um 19:28 hat Max Reitz geschrieben:
> Currently, bdrv_replace_child_noperm() undrains the parent until it is
> completely undrained, then re-drains it after attaching the new child
> node.
>
> This is a problem with bdrv_drop_intermediate(): We want to keep the
> whole subtree drained, including parents, while the operation is
> under way. bdrv_replace_child_noperm() breaks this by allowing every
> parent to become unquiesced briefly, and then redraining it.
>
> In fact, there is no reason why the parent should become unquiesced and
> be allowed to submit requests to the new child node if that new node is
> supposed to be kept drained. So if anything, we have to drain the
> parent before detaching the old child node. Conversely, we have to
> undrain it only after attaching the new child node.
>
> Thus, change the whole drain algorithm here: Calculate the number of
> times we have to drain/undrain the parent before replacing the child
> node then drain it (if necessary), replace the child node, and then
> undrain it.
>
> Signed-off-by: Max Reitz <address@hidden>
I think this looks good (and fixes a bug that Denis Plotnikov reported
before while trying to fix IDE submitting requests in a drained
section), but I would be even more confident if we could add tests for
the various cases to tests/test-bdrv-drain.c.
Kevin
- [Qemu-devel] [PATCH v2 00/12] block: Fixes for concurrent block jobs, Max Reitz, 2019/07/03
- [Qemu-devel] [PATCH v2 01/12] block: Add BDS.never_freeze, Max Reitz, 2019/07/03
- [Qemu-devel] [PATCH v2 04/12] block: Keep subtree drained in drop_intermediate, Max Reitz, 2019/07/03
- [Qemu-devel] [PATCH v2 11/12] iotests: Add read-only test case to 030, Max Reitz, 2019/07/03
- [Qemu-devel] [PATCH v2 02/12] block/stream: Fix error path, Max Reitz, 2019/07/03
- [Qemu-devel] [PATCH v2 05/12] block: Reduce (un)drains when replacing a child, Max Reitz, 2019/07/03
- Re: [Qemu-devel] [PATCH v2 05/12] block: Reduce (un)drains when replacing a child,
Kevin Wolf <=
- [Qemu-devel] [PATCH v2 09/12] iotests: Add @use_log to VM.run_job(), Max Reitz, 2019/07/03
- [Qemu-devel] [PATCH v2 12/12] iotests: Add test for concurrent stream/commit, Max Reitz, 2019/07/03
- [Qemu-devel] [PATCH v2 07/12] iotests: Fix throttling in 030, Max Reitz, 2019/07/03
- [Qemu-devel] [PATCH v2 03/12] block/stream: Swap backing file change order, Max Reitz, 2019/07/03
- [Qemu-devel] [PATCH v2 08/12] iotests: Compare error messages in 030, Max Reitz, 2019/07/03
- [Qemu-devel] [PATCH v2 06/12] block: Deep-clear inherits_from, Max Reitz, 2019/07/03