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

2014-11-24 Thread Paolo Bonzini
On 24/11/2014 11:02, Ming Lei wrote: >> > Right, but "-1" is "-EPERM" which doesn't make much sense. I think the >> > right thing to do is to return EAGAIN, and let the owner figure it out. >> > For example, a SCSI device might return a "BUSY" status code. > We can do that, but laio_submit() do

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

2014-11-24 Thread Ming Lei
On Mon, Nov 24, 2014 at 5:47 PM, Paolo Bonzini wrote: > > > On 22/11/2014 13:16, 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)) { >> > > +

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

2014-11-24 Thread Paolo Bonzini
On 22/11/2014 13:16, 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)) { > > > +return -1; > > > > return -EAGAIN? > > It means the io queue is

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

2014-11-22 Thread Ming Lei
On Tue, Nov 18, 2014 at 10:18 PM, Paolo Bonzini wrote: > > >> @@ -137,6 +145,12 @@ static void qemu_laio_completion_bh(void *opaque) >> } >> } >> >> +static void qemu_laio_start_retry(struct qemu_laio_state *s) >> +{ >> +if (s->io_q.idx) >> +qemu_bh_schedule(s->io_q.retry); >> +}

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

2014-11-18 Thread Paolo Bonzini
> @@ -137,6 +145,12 @@ static void qemu_laio_completion_bh(void *opaque) > } > } > > +static void qemu_laio_start_retry(struct qemu_laio_state *s) > +{ > +if (s->io_q.idx) > +qemu_bh_schedule(s->io_q.retry); > +} > + > static void qemu_laio_completion_cb(EventNotifier *e) >

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

2014-11-06 Thread Ming Lei
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: - for -EAGAIN or partial completion, retry the submision by schedule an BH in following completion cb - for part of c