[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 3/3] linux-aio: process completions from ioq_sub
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH 3/3] linux-aio: process completions from ioq_submit() |
Date: |
Tue, 19 Jul 2016 12:36:25 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 |
On 19/07/2016 12:25, Roman Pen wrote:
> if (laiocb->co) {
> - qemu_coroutine_enter(laiocb->co, NULL);
> + if (laiocb->co == qemu_coroutine_self()) {
> + laiocb->self_completed = true;
No need for this new field. You can just do nothing here and check
laiocb.ret == -EINPROGRESS here in laio_co_submit.
> + } else {
> + qemu_coroutine_enter(laiocb->co, NULL);
> + }
> } else {
> laiocb->common.cb(laiocb->common.opaque, ret);
> qemu_aio_unref(laiocb);
> @@ -312,6 +317,12 @@ static void ioq_submit(LinuxAioState *s)
> QSIMPLEQ_SPLIT_AFTER(&s->io_q.pending, aiocb, next, &completed);
> } while (ret == len && !QSIMPLEQ_EMPTY(&s->io_q.pending));
> s->io_q.blocked = (s->io_q.in_queue > 0);
> +
> + if (s->io_q.in_flight) {
> + /* We can try to complete something just right away if there are
> + * still requests in-flight. */
> + qemu_laio_process_completions(s);
> + }
Can this leave I/O stuck if in_queue > 0 && in_flight == 0 after the
return from qemu_laio_process_completions? I think you need to goto the
beginning of the function to submit more I/O requests in that case.
In fact, perhaps it's useful to always do so if any I/Os were completed.
Should qemu_laio_process_completions return the number of completed
requests?
Paolo
> }
>
> void laio_io_plug(BlockDriverState *bs, LinuxAioState *s)
- [Qemu-devel] [PATCH 0/3] linux-aio: reduce completion latency, Roman Pen, 2016/07/19
- [Qemu-devel] [PATCH 2/3] linux-aio: split processing events function, Roman Pen, 2016/07/19
- [Qemu-devel] [PATCH 1/3] linux-aio: consume events in userspace instead of calling io_getevents, Roman Pen, 2016/07/19
- [Qemu-devel] [PATCH 3/3] linux-aio: process completions from ioq_submit(), Roman Pen, 2016/07/19
- Re: [Qemu-devel] [PATCH 3/3] linux-aio: process completions from ioq_submit(),
Paolo Bonzini <=
- Re: [Qemu-devel] [PATCH 3/3] linux-aio: process completions from ioq_submit(), Roman Penyaev, 2016/07/19
- Re: [Qemu-devel] [PATCH 3/3] linux-aio: process completions from ioq_submit(), Paolo Bonzini, 2016/07/19
- Re: [Qemu-devel] [PATCH 3/3] linux-aio: process completions from ioq_submit(), Roman Penyaev, 2016/07/19
- Re: [Qemu-devel] [PATCH 3/3] linux-aio: process completions from ioq_submit(), Paolo Bonzini, 2016/07/19
- Re: [Qemu-devel] [PATCH 3/3] linux-aio: process completions from ioq_submit(), Roman Penyaev, 2016/07/19