Re: [Qemu-devel] [PATCH v4 1/3] linux-aio: fix submit aio as a batch

2014-11-24 Thread Ming Lei
On Mon, Nov 24, 2014 at 7:39 PM, Paolo Bonzini wrote: > > > On 24/11/2014 12:31, Ming Lei wrote: >> +static int ioq_enqueue(struct qemu_laio_state *s, struct iocb *iocb) >> { >> unsigned int idx = s->io_q.idx; >> >> +if (unlikely(idx == s->io_q.size)) { >> +ioq_submit(s); >> +

Re: [Qemu-devel] [PATCH v4 1/3] linux-aio: fix submit aio as a batch

2014-11-24 Thread Paolo Bonzini
On 24/11/2014 12:31, Ming Lei wrote: > +static int ioq_enqueue(struct qemu_laio_state *s, struct iocb *iocb) > { > unsigned int idx = s->io_q.idx; > > +if (unlikely(idx == s->io_q.size)) { > +ioq_submit(s); > +return -EAGAIN; Only return -EAGAIN if ioq_submit(s) retur

[Qemu-devel] [PATCH v4 1/3] linux-aio: fix submit aio as a batch

2014-11-24 Thread Ming Lei
In the submit path, we can't complete request directly, otherwise "Co-routine re-entered recursively" may be caused, so this patch fixes the issue with below ideas: - for -EAGAIN or partial completion, retry the submision in following completion cb which is run in BH context