[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v6 1/3] linux-aio: fix submit aio as a batch
From: |
Ming Lei |
Subject: |
Re: [Qemu-devel] [PATCH v6 1/3] linux-aio: fix submit aio as a batch |
Date: |
Tue, 25 Nov 2014 22:45:05 +0800 |
On Tue, Nov 25, 2014 at 9:08 PM, Stefan Hajnoczi <address@hidden> wrote:
> On Tue, Nov 25, 2014 at 03:23:11PM +0800, Ming Lei wrote:
>> @@ -296,12 +370,14 @@ void laio_detach_aio_context(void *s_, AioContext
>> *old_context)
>>
>> aio_set_event_notifier(old_context, &s->e, NULL);
>> qemu_bh_delete(s->completion_bh);
>> + qemu_bh_delete(s->io_q.abort_bh);
>> }
>>
>> void laio_attach_aio_context(void *s_, AioContext *new_context)
>> {
>> struct qemu_laio_state *s = s_;
>>
>> + s->io_q.abort_bh = aio_bh_new(new_context, ioq_abort_bh, s);
>> s->completion_bh = aio_bh_new(new_context, qemu_laio_completion_bh, s);
>> aio_set_event_notifier(new_context, &s->e, qemu_laio_completion_cb);
>> }
>
> These functions are incomplete when ->aborting == true. I can't think
Could you explain in a bit when ->aborting is true during attach callback?
> of a reason why we are guaranteed never to hit that state, and fixing it
> is easy. Just add the following to the end of
> laio_attach_aio_context():
>
> if (s->aborting) {
> qemu_bh_schedule(s->io_q.abort_bh);
> }
You mean the abort BH may not have chance to run before its deletion
in the detach callback?
If so, bdrv_drain_all() from bdrv_set_aio_context() should have
handled the pending BH, right?
Thanks,
Ming Lei
- [Qemu-devel] [PATCH v6 0/3] linux-aio: fix batch submission, Ming Lei, 2014/11/25
- [Qemu-devel] [PATCH v6 1/3] linux-aio: fix submit aio as a batch, Ming Lei, 2014/11/25
- Re: [Qemu-devel] [PATCH v6 1/3] linux-aio: fix submit aio as a batch, Stefan Hajnoczi, 2014/11/25
- Re: [Qemu-devel] [PATCH v6 1/3] linux-aio: fix submit aio as a batch,
Ming Lei <=
- Re: [Qemu-devel] [PATCH v6 1/3] linux-aio: fix submit aio as a batch, Stefan Hajnoczi, 2014/11/25
- Re: [Qemu-devel] [PATCH v6 1/3] linux-aio: fix submit aio as a batch, Ming Lei, 2014/11/26
- Re: [Qemu-devel] [PATCH v6 1/3] linux-aio: fix submit aio as a batch, Stefan Hajnoczi, 2014/11/27
- Re: [Qemu-devel] [PATCH v6 1/3] linux-aio: fix submit aio as a batch, Paolo Bonzini, 2014/11/27
- Re: [Qemu-devel] [PATCH v6 1/3] linux-aio: fix submit aio as a batch, Ming Lei, 2014/11/27
Re: [Qemu-devel] [PATCH v6 1/3] linux-aio: fix submit aio as a batch, Kevin Wolf, 2014/11/26
Re: [Qemu-devel] [PATCH v6 1/3] linux-aio: fix submit aio as a batch, Kevin Wolf, 2014/11/26
[Qemu-devel] [PATCH v6 2/3] linux-aio: handling -EAGAIN for !s->io_q.plugged case, Ming Lei, 2014/11/25