[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1/1] Revert "linux-aio: Cancel BH if not needed"

From: Kevin Wolf
Subject: Re: [Qemu-devel] [PATCH 1/1] Revert "linux-aio: Cancel BH if not needed"
Date: Fri, 24 Jun 2016 16:46:05 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

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?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]