Re: [Qemu-devel] [PATCH RFC 4/4] aio-posix: Use epoll in aio_poll

2015-07-13 Thread Stefan Hajnoczi
On Fri, Jul 10, 2015 at 08:46:44AM +0800, Fam Zheng wrote: > On Wed, 07/08 11:58, Stefan Hajnoczi wrote: > > On Wed, Jul 08, 2015 at 09:01:27AM +0800, Fam Zheng wrote: > > > On Tue, 07/07 16:08, Stefan Hajnoczi wrote: > > > > > +#define EPOLL_BATCH 128 > > > > > +static bool aio_poll_epoll(AioConte

Re: [Qemu-devel] [PATCH RFC 4/4] aio-posix: Use epoll in aio_poll

2015-07-09 Thread Fam Zheng
On Wed, 07/08 11:58, Stefan Hajnoczi wrote: > On Wed, Jul 08, 2015 at 09:01:27AM +0800, Fam Zheng wrote: > > On Tue, 07/07 16:08, Stefan Hajnoczi wrote: > > > > +#define EPOLL_BATCH 128 > > > > +static bool aio_poll_epoll(AioContext *ctx, bool blocking) > > > > +{ > > > > +AioHandler *node; > >

Re: [Qemu-devel] [PATCH RFC 4/4] aio-posix: Use epoll in aio_poll

2015-07-08 Thread Stefan Hajnoczi
On Wed, Jul 08, 2015 at 09:01:27AM +0800, Fam Zheng wrote: > On Tue, 07/07 16:08, Stefan Hajnoczi wrote: > > > +#define EPOLL_BATCH 128 > > > +static bool aio_poll_epoll(AioContext *ctx, bool blocking) > > > +{ > > > +AioHandler *node; > > > +bool was_dispatching; > > > +int i, ret; > >

Re: [Qemu-devel] [PATCH RFC 4/4] aio-posix: Use epoll in aio_poll

2015-07-07 Thread Fam Zheng
On Tue, 07/07 16:08, Stefan Hajnoczi wrote: > > @@ -44,6 +47,12 @@ static AioHandler *find_aio_handler(AioContext *ctx, int > > fd) > > > > void aio_context_setup(AioContext *ctx, Error **errp) > > { > > +#ifdef CONFIG_EPOLL > > +ctx->epollfd = epoll_create1(EPOLL_CLOEXEC); > > +if (ct

Re: [Qemu-devel] [PATCH RFC 4/4] aio-posix: Use epoll in aio_poll

2015-07-07 Thread Paolo Bonzini
On 07/07/2015 17:08, Stefan Hajnoczi wrote: >> > + >> > +#define EPOLL_BATCH 128 >> > +static bool aio_poll_epoll(AioContext *ctx, bool blocking) >> > +{ >> > +AioHandler *node; >> > +bool was_dispatching; >> > +int i, ret; >> > +bool progress; >> > +int64_t timeout; >> > +

Re: [Qemu-devel] [PATCH RFC 4/4] aio-posix: Use epoll in aio_poll

2015-07-07 Thread Stefan Hajnoczi
On Tue, Jun 30, 2015 at 09:19:45PM +0800, Fam Zheng wrote: > = > # of scsi-disks |master | epoll >| rd wrrandrw | rdwrrandrw > ---

[Qemu-devel] [PATCH RFC 4/4] aio-posix: Use epoll in aio_poll

2015-06-30 Thread Fam Zheng
This patch let aio_poll use epoll_wait(2) syscall instead of qemu_poll_ns, if possible. It improves scalability of iothread (for example, virtio-scsi-dataplane.) The epollfd is managed together with the GSource and ctx->aio_handlers, by creating epoll_event instances for each watched aio fd and ad