Re: [Qemu-block] [Qemu-devel] [PATCH v2 11/11] block: Only poll block layer fds in bdrv_aio_poll

2015-09-11 Thread Daniel P. Berrange
On Fri, Sep 11, 2015 at 11:36:10AM +0200, Alberto Garcia wrote: > On Fri 11 Sep 2015 11:14:33 AM CEST, Fam Zheng wrote: > > >> > Another advantage for bdrv_aio_poll() is, in main loop we will not > >> > need a separate AioContext in changes like: > >> > > >> >

Re: [Qemu-block] [Qemu-devel] [PATCH v2 11/11] block: Only poll block layer fds in bdrv_aio_poll

2015-09-11 Thread Alberto Garcia
On Fri 11 Sep 2015 11:14:33 AM CEST, Fam Zheng wrote: >> > Another advantage for bdrv_aio_poll() is, in main loop we will not >> > need a separate AioContext in changes like: >> > >> > http://patchwork.ozlabs.org/patch/514968/ >> > >> > Because nested aio_poll will

Re: [Qemu-block] [Qemu-devel] [PATCH v2 11/11] block: Only poll block layer fds in bdrv_aio_poll

2015-09-11 Thread Fam Zheng
On Fri, 09/11 11:36, Alberto Garcia wrote: > On Fri 11 Sep 2015 11:14:33 AM CEST, Fam Zheng wrote: > > >> > Another advantage for bdrv_aio_poll() is, in main loop we will not > >> > need a separate AioContext in changes like: > >> > > >> >

Re: [Qemu-block] [Qemu-devel] [PATCH v2 11/11] block: Only poll block layer fds in bdrv_aio_poll

2015-09-11 Thread Fam Zheng
On Fri, 09/11 10:15, Paolo Bonzini wrote: > > > On 09/09/2015 05:22, Fam Zheng wrote: > > Another advantage for bdrv_aio_poll() is, in main loop we will not need > > a separate AioContext in changes like: > > > > http://patchwork.ozlabs.org/patch/514968/ > > > > Because nested aio_poll will

Re: [Qemu-block] [Qemu-devel] [PATCH v2 11/11] block: Only poll block layer fds in bdrv_aio_poll

2015-09-11 Thread Paolo Bonzini
On 11/09/2015 11:36, Alberto Garcia wrote: > > > > Because nested aio_poll will automatically be limited to only > > > > process block layer events. My idea is to eventually let main loop > > > > use aio_poll > > > > > > That would be a step back. Using GSource is useful because it lets > > >

Re: [Qemu-block] [Qemu-devel] [PATCH v2 11/11] block: Only poll block layer fds in bdrv_aio_poll

2015-09-11 Thread Paolo Bonzini
On 09/09/2015 05:22, Fam Zheng wrote: > Another advantage for bdrv_aio_poll() is, in main loop we will not need > a separate AioContext in changes like: > > http://patchwork.ozlabs.org/patch/514968/ > > Because nested aio_poll will automatically be limited to only process block > layer events.

Re: [Qemu-block] [Qemu-devel] [PATCH v2 11/11] block: Only poll block layer fds in bdrv_aio_poll

2015-09-08 Thread Fam Zheng
On Wed, 07/29 14:03, Paolo Bonzini wrote: > > > On 29/07/2015 13:53, Fam Zheng wrote: > >> > Yes, though I think you'd end up reverting patches 10 and 11 in the end. > > We will add outer disable/enable pairs to prevent another threads's aio_poll > > from sneaking in between bdrv_aio_poll calls,

Re: [Qemu-block] [Qemu-devel] [PATCH v2 11/11] block: Only poll block layer fds in bdrv_aio_poll

2015-07-29 Thread Fam Zheng
On Wed, 07/29 14:03, Paolo Bonzini wrote: On 29/07/2015 13:53, Fam Zheng wrote: Yes, though I think you'd end up reverting patches 10 and 11 in the end. We will add outer disable/enable pairs to prevent another threads's aio_poll from sneaking in between bdrv_aio_poll calls, but we

Re: [Qemu-block] [Qemu-devel] [PATCH v2 11/11] block: Only poll block layer fds in bdrv_aio_poll

2015-07-29 Thread Paolo Bonzini
On 29/07/2015 12:57, Fam Zheng wrote: On Wed, 07/29 09:37, Paolo Bonzini wrote: On 29/07/2015 06:42, Fam Zheng wrote: @@ -2613,6 +2613,8 @@ bool bdrv_aio_poll(AioContext *ctx, bool blocking) { bool ret; +aio_disable_clients(ctx, AIO_CLIENT_DATAPLANE | AIO_CLIENT_NBD_SERVER);

Re: [Qemu-block] [Qemu-devel] [PATCH v2 11/11] block: Only poll block layer fds in bdrv_aio_poll

2015-07-29 Thread Fam Zheng
On Wed, 07/29 09:37, Paolo Bonzini wrote: On 29/07/2015 06:42, Fam Zheng wrote: @@ -2613,6 +2613,8 @@ bool bdrv_aio_poll(AioContext *ctx, bool blocking) { bool ret; +aio_disable_clients(ctx, AIO_CLIENT_DATAPLANE | AIO_CLIENT_NBD_SERVER); ret = aio_poll(ctx,

Re: [Qemu-block] [Qemu-devel] [PATCH v2 11/11] block: Only poll block layer fds in bdrv_aio_poll

2015-07-29 Thread Paolo Bonzini
On 29/07/2015 13:53, Fam Zheng wrote: Yes, though I think you'd end up reverting patches 10 and 11 in the end. We will add outer disable/enable pairs to prevent another threads's aio_poll from sneaking in between bdrv_aio_poll calls, but we needn't obsolete bdrv_aio_poll() because of that -