Re: [Qemu-devel] [PATCH] linux-aio: fix submit aio as a batch

2014-07-11 Thread Ming Lei
On Wed, Jul 9, 2014 at 4:29 PM, Stefan Hajnoczi wrote: > On Tue, Jul 08, 2014 at 11:45:10PM +0800, Ming Lei wrote: >> In the enqueue path, we can't complete request, otherwise >> "Co-routine re-entered recursively" may be caused, so this >> patch fixes the issue with below ideas: > > Thi probably

Re: [Qemu-devel] [PATCH] linux-aio: fix submit aio as a batch

2014-07-10 Thread Paolo Bonzini
Il 08/07/2014 17:45, Ming Lei ha scritto: -/* empty io queue */ -s->io_q.idx = 0; +ret = io_submit(s->ctx, len, s->io_q.iocbs); +if (ret == -EAGAIN) { +event_notifier_set(&s->retry); +return 0; You can use a bottom half instead of this event notifier. Paolo

Re: [Qemu-devel] [PATCH] linux-aio: fix submit aio as a batch

2014-07-09 Thread Eric Blake
On 07/09/2014 02:29 AM, Stefan Hajnoczi wrote: >> +if (enqueue) >> +return ret; > > Please set up a git hook to run checkpatch.pl. It will alert you when > you violate QEMU coding style: > http://blog.vmsplice.net/2011/03/how-to-automatically-run-checkpatchpl.html > > I alre

Re: [Qemu-devel] [PATCH] linux-aio: fix submit aio as a batch

2014-07-09 Thread Stefan Hajnoczi
On Tue, Jul 08, 2014 at 11:45:10PM +0800, Ming Lei wrote: > In the enqueue path, we can't complete request, otherwise > "Co-routine re-entered recursively" may be caused, so this > patch fixes the issue with below ideas: Thi probably happens when the caller is in coroutine context and its complet

Re: [Qemu-devel] [PATCH] linux-aio: fix submit aio as a batch

2014-07-08 Thread Ming Lei
On Wed, Jul 9, 2014 at 1:41 AM, Paolo Bonzini wrote: > Il 08/07/2014 17:45, Ming Lei ha scritto: > >> >> -/* empty io queue */ >> -s->io_q.idx = 0; >> +ret = io_submit(s->ctx, len, s->io_q.iocbs); >> +if (ret == -EAGAIN) { >> +event_notifier_set(&s->retry); >> +retu