Re: [Qemu-devel] [RFC 1/3] aio-posix: add aio_set_poll_handler()

2016-11-15 Thread Fam Zheng
On Wed, 11/09 17:13, Stefan Hajnoczi wrote: > +struct AioPollHandler { > +QLIST_ENTRY(AioPollHandler) node; > + > +AioPollFn *poll_fn; /* check whether to invoke io_fn() */ > +IOHandler *io_fn; /* handler callback */ > +void *opaque; /* user-defined argument to c

Re: [Qemu-devel] [RFC 1/3] aio-posix: add aio_set_poll_handler()

2016-11-10 Thread Paolo Bonzini
On Thursday, November 10, 2016 11:17:35 AM, Stefan Hajnoczi wrote: > > I think the question is not "is there any polling to be done" but rather > > "is there anything that requires looking at a file descriptor". If you > > have e.g. an NBD device on the AioContext you cannot poll. On the other

Re: [Qemu-devel] [RFC 1/3] aio-posix: add aio_set_poll_handler()

2016-11-10 Thread Stefan Hajnoczi
On Wed, Nov 09, 2016 at 06:30:11PM +0100, Paolo Bonzini wrote: Thanks for the feedback. I hope that Karl will be able to find a QEMU_AIO_POLL_MAX_NS setting that improves the benchmark. At that point I'll send a new version of this series so we can iron out the details. > > +static bool run_pol

Re: [Qemu-devel] [RFC 1/3] aio-posix: add aio_set_poll_handler()

2016-11-09 Thread Paolo Bonzini
On 09/11/2016 18:13, Stefan Hajnoczi wrote: > Poll handlers are executed for a certain amount of time before the event > loop polls file descriptors. This can be used to keep the event loop > thread scheduled and may therefore recognize events faster than blocking > poll(2) calls. > > This is a

[Qemu-devel] [RFC 1/3] aio-posix: add aio_set_poll_handler()

2016-11-09 Thread Stefan Hajnoczi
Poll handlers are executed for a certain amount of time before the event loop polls file descriptors. This can be used to keep the event loop thread scheduled and may therefore recognize events faster than blocking poll(2) calls. This is an experimental feature to reduce I/O latency in high IOPS