[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v4] throttle-groups: drain before detaching Thro
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH v4] throttle-groups: drain before detaching ThrottleState |
Date: |
Mon, 13 Nov 2017 14:12:17 +0000 |
User-agent: |
Mutt/1.9.1 (2017-09-22) |
On Fri, Nov 10, 2017 at 03:19:34PM +0000, Stefan Hajnoczi wrote:
> I/O requests hang after stop/cont commands at least since QEMU 2.10.0
> with -drive iops=100:
>
> (guest)$ dd if=/dev/zero of=/dev/vdb oflag=direct count=1000
> (qemu) stop
> (qemu) cont
> ...I/O is stuck...
>
> This happens because blk_set_aio_context() detaches the ThrottleState
> while requests may still be in flight:
>
> if (tgm->throttle_state) {
> throttle_group_detach_aio_context(tgm);
> throttle_group_attach_aio_context(tgm, new_context);
> }
>
> This patch encloses the detach/attach calls in a drained region so no
> I/O request is left hanging. Also add assertions so we don't make the
> same mistake again in the future.
>
> Reported-by: Yongxue Hong <address@hidden>
> Signed-off-by: Stefan Hajnoczi <address@hidden>
> ---
> v4:
> * Simplified patch in response to Berto's review
> ---
> block/block-backend.c | 2 ++
> block/throttle-groups.c | 6 ++++++
> 2 files changed, 8 insertions(+)
Thanks, applied to my block tree:
https://github.com/stefanha/qemu/commits/block
Stefan
signature.asc
Description: PGP signature