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

2014-11-24 Thread Stefan Hajnoczi
On Mon, Nov 24, 2014 at 10:29:37PM +0800, Ming Lei wrote: > +static void ioq_abort_bh(void *opaque) > +{ > +struct qemu_laio_state *s = opaque; > +int i; > + > +for (i = 0; i < s->io_q.idx; i++) { > +struct qemu_laiocb *laiocb = container_of(s->io_q.iocbs[i], > +

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

2014-11-24 Thread Stefan Hajnoczi
On Mon, Nov 24, 2014 at 10:29:37PM +0800, Ming Lei wrote: > +/* submit immediately if queue depth is above 2/3 */ > +if (idx > s->io_q.size * 2 / 3) { > +return ioq_submit(s); The return value of ioq_submit() is the number of requests submitted (0 or more). This has no meaning to

[Qemu-devel] [PATCH v5 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