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

2014-11-27 Thread Stefan Hajnoczi
On Wed, Nov 26, 2014 at 05:15:44PM +0800, Ming Lei wrote: On Wed, Nov 26, 2014 at 12:18 AM, Stefan Hajnoczi stefa...@gmail.com wrote: You mean the abort BH may not have chance to run before its deletion in the detach callback? Exactly. Any time you schedule a BH you need to be aware of

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

2014-11-27 Thread Paolo Bonzini
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 27/11/2014 17:56, Stefan Hajnoczi wrote: I am asking for a one-line if statement to avoid introducing a subtle assumption that would be a pain to debug in the future. It's so easy to add that I'm against merging the patch without this

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

2014-11-27 Thread Ming Lei
On Wed, Nov 26, 2014 at 7:18 PM, Kevin Wolf kw...@redhat.com wrote: Am 25.11.2014 um 08:23 hat Ming Lei geschrieben: 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

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

2014-11-27 Thread Ming Lei
On Fri, Nov 28, 2014 at 12:58 AM, Paolo Bonzini pbonz...@redhat.com wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 27/11/2014 17:56, Stefan Hajnoczi wrote: I am asking for a one-line if statement to avoid introducing a subtle assumption that would be a pain to debug in the future.

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

2014-11-26 Thread Ming Lei
On Wed, Nov 26, 2014 at 12:18 AM, Stefan Hajnoczi stefa...@gmail.com wrote: You mean the abort BH may not have chance to run before its deletion in the detach callback? Exactly. Any time you schedule a BH you need to be aware of things that may happen before the BH is invoked. If so,

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

2014-11-26 Thread Kevin Wolf
Am 25.11.2014 um 08:23 hat Ming Lei geschrieben: 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

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

2014-11-26 Thread Kevin Wolf
Am 25.11.2014 um 08:23 hat Ming Lei geschrieben: In the submit path, we can't complete request directly, otherwise Co-routine re-entered recursively may be caused, One more thing: Can you write a qemu-iotests case to test this code path? (Which should fail on master and be fixed with this

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

2014-11-25 Thread Stefan Hajnoczi
On Tue, Nov 25, 2014 at 03:23:11PM +0800, Ming Lei wrote: @@ -296,12 +370,14 @@ void laio_detach_aio_context(void *s_, AioContext *old_context) aio_set_event_notifier(old_context, s-e, NULL); qemu_bh_delete(s-completion_bh); +qemu_bh_delete(s-io_q.abort_bh); } void

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

2014-11-25 Thread Ming Lei
On Tue, Nov 25, 2014 at 9:08 PM, Stefan Hajnoczi stefa...@redhat.com wrote: On Tue, Nov 25, 2014 at 03:23:11PM +0800, Ming Lei wrote: @@ -296,12 +370,14 @@ void laio_detach_aio_context(void *s_, AioContext *old_context) aio_set_event_notifier(old_context, s-e, NULL);

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

2014-11-25 Thread Stefan Hajnoczi
On Tue, Nov 25, 2014 at 10:45:05PM +0800, Ming Lei wrote: On Tue, Nov 25, 2014 at 9:08 PM, Stefan Hajnoczi stefa...@redhat.com wrote: On Tue, Nov 25, 2014 at 03:23:11PM +0800, Ming Lei wrote: @@ -296,12 +370,14 @@ void laio_detach_aio_context(void *s_, AioContext *old_context)

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