From: Kevin Wolf <kwolf@redhat.com>
To: Roman Pen <roman.penyaev@profitbricks.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>,
qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 1/1] Revert "linux-aio: Cancel BH if not needed"
Date: Fri, 24 Jun 2016 16:46:05 +0200 [thread overview]
Message-ID: <20160624144605.GF5422@noname.redhat.com> (raw)
In-Reply-To: <1466775608-31052-1-git-send-email-roman.penyaev@profitbricks.com>
Am 24.06.2016 um 15:40 hat Roman Pen geschrieben:
> This reverts commit ccb9dc10129954d0bcd7814298ed445e684d5a2a,
> which causes MQ stuck while doing IO thru virtio_blk.
It would be good to have a theory why this happens.
> diff --git a/block/linux-aio.c b/block/linux-aio.c
> index e468960..fe7cece 100644
> --- a/block/linux-aio.c
> +++ b/block/linux-aio.c
> @@ -149,8 +149,6 @@ static void qemu_laio_completion_bh(void *opaque)
> if (!s->io_q.plugged && !QSIMPLEQ_EMPTY(&s->io_q.pending)) {
> ioq_submit(s);
> }
> -
> - qemu_bh_cancel(s->completion_bh);
> }
Maybe if a nested event loops cancels the BH, it's missing on the next
loop iteration. Before my patch, the nested callback happened to leave
an additional BH around which the outer one actually needs.
I find this a bit ugly, but if we're okay with this mechanism we could
add a counter for the nesting level and only cancel on the top level.
If you find it as ugly as I do, a cleaner solution would be to schedule
the BH inside the loop.
> @@ -158,7 +156,7 @@ static void qemu_laio_completion_cb(EventNotifier *e)
> LinuxAioState *s = container_of(e, LinuxAioState, e);
>
> if (event_notifier_test_and_clear(&s->e)) {
> - qemu_laio_completion_bh(s);
> + qemu_bh_schedule(s->completion_bh);
> }
> }
I can't see how this hunk would make a difference. Can you confirm that
just the first hunk is enough to fix the problem?
Kevin
next prev parent reply other threads:[~2016-06-24 14:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-24 13:40 [Qemu-devel] [PATCH 1/1] Revert "linux-aio: Cancel BH if not needed" Roman Pen
2016-06-24 14:46 ` Kevin Wolf [this message]
2016-06-27 15:09 ` Stefan Hajnoczi
2016-06-28 8:41 ` Stefan Hajnoczi
2016-06-27 16:01 ` 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=20160624144605.GF5422@noname.redhat.com \
--to=kwolf@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=roman.penyaev@profitbricks.com \
--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).