qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Manos Pitsidianakis <el13635@mail.ntua.gr>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: qemu-devel@nongnu.org, Max Reitz <mreitz@redhat.com>,
	Kevin Wolf <kwolf@redhat.com>,
	qemu-block@nongnu.org, Alberto Garcia <berto@igalia.com>
Subject: Re: [Qemu-devel] [PATCH v2] throttle-groups: update tg->any_timer_armed[] on detach
Date: Wed, 20 Sep 2017 13:34:17 +0300	[thread overview]
Message-ID: <20170920103417.kch7vp6dcn2bueqb@postretch> (raw)
In-Reply-To: <20170920101740.12490-1-stefanha@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1662 bytes --]

On Wed, Sep 20, 2017 at 11:17:40AM +0100, Stefan Hajnoczi wrote:
>Clear tg->any_timer_armed[] when throttling timers are destroyed during
>AioContext attach/detach.  Failure to do so causes throttling to hang
>because we believe the timer is already scheduled!
>
>The following was broken at least since QEMU 2.10.0 with -drive
>iops=100:
>
>  $ dd if=/dev/zero of=/dev/vdb oflag=direct count=1000
>  (qemu) stop
>  (qemu) cont
>  ...I/O is stuck...
>
>Reported-by: Yongxue Hong <yhong@redhat.com>
>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>

Reviewed-by: Manos Pitsidianakis <el13635@mail.ntua.gr>


>v2:
> * Use timer_pending(tt->timers[i]) instead of token [Berto]
> * Fix s/destroy/destroyed/ typo [Eric]
>
> block/throttle-groups.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
>diff --git a/block/throttle-groups.c b/block/throttle-groups.c
>index 6ba992c8d7..0a49f3c409 100644
>--- a/block/throttle-groups.c
>+++ b/block/throttle-groups.c
>@@ -592,6 +592,17 @@ void throttle_group_attach_aio_context(ThrottleGroupMember *tgm,
> void throttle_group_detach_aio_context(ThrottleGroupMember *tgm)
> {
>     ThrottleTimers *tt = &tgm->throttle_timers;
>+    ThrottleGroup *tg = container_of(tgm->throttle_state, ThrottleGroup, ts);
>+
>+    qemu_mutex_lock(&tg->lock);
>+    if (timer_pending(tt->timers[0])) {
>+        tg->any_timer_armed[0] = false;
>+    }
>+    if (timer_pending(tt->timers[1])) {
>+        tg->any_timer_armed[1] = false;
>+    }
>+    qemu_mutex_unlock(&tg->lock);
>+
>     throttle_timers_detach_aio_context(tt);
>     tgm->aio_context = NULL;
> }
>-- 
>2.13.5
>
>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2017-09-20 13:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-20 10:17 [Qemu-devel] [PATCH v2] throttle-groups: update tg->any_timer_armed[] on detach Stefan Hajnoczi
2017-09-20 10:34 ` Manos Pitsidianakis [this message]
2017-09-20 11:08 ` Alberto Garcia
2017-09-20 11:39   ` Manos Pitsidianakis
2017-09-20 12:17     ` Alberto Garcia
2017-09-20 14:16       ` Stefan Hajnoczi

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=20170920103417.kch7vp6dcn2bueqb@postretch \
    --to=el13635@mail.ntua.gr \
    --cc=berto@igalia.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /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).