Re: [kvm-devel] [PATCH 3/3] Implement linux-aio backend
On Thu, Apr 17, 2008 at 02:26:52PM -0500, Anthony Liguori wrote: This patch introduces a Linux-aio backend that is disabled by default. To use this backend effectively, the user should disable caching and select it with the appropriate -aio option. For instance: qemu-system-x86_64 -drive foo.img,cache=off -aio linux There's no universal way to asynchronous wait with linux-aio. At some point, signals were added to signal completion. More recently, and eventfd interface was added. This patch relies on the later. We try hard to detect whether the right support is available in configure to avoid compile failures. +do { + err = io_submit(aio_ctxt_id, 1, iocbs); +} while (err == -1 errno == EINTR); + +if (err != 1) { + fprintf(stderr, failed to submit aio request: %m\n); + exit(1); +} + +outstanding_requests++; + +return aiocb-common; +} + +static void la_wait(void) +{ +main_loop_wait(10); +} Sleeping in the context of vcpu's is extremely bad (eg virtio-block blocks in write() throttling which kills performance). It should wait on IO completions instead (qemu-kvm.c creates a pthread waitqueue to resolve that issue). Other than that looks fine to me, will give it a try. - This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
Re: [kvm-devel] [PATCH 3/3] Implement linux-aio backend
Marcelo Tosatti wrote: On Thu, Apr 17, 2008 at 02:26:52PM -0500, Anthony Liguori wrote: This patch introduces a Linux-aio backend that is disabled by default. To use this backend effectively, the user should disable caching and select it with the appropriate -aio option. For instance: qemu-system-x86_64 -drive foo.img,cache=off -aio linux There's no universal way to asynchronous wait with linux-aio. At some point, signals were added to signal completion. More recently, and eventfd interface was added. This patch relies on the later. We try hard to detect whether the right support is available in configure to avoid compile failures. +do { +err = io_submit(aio_ctxt_id, 1, iocbs); +} while (err == -1 errno == EINTR); + +if (err != 1) { +fprintf(stderr, failed to submit aio request: %m\n); +exit(1); +} + +outstanding_requests++; + +return aiocb-common; +} + +static void la_wait(void) +{ +main_loop_wait(10); +} Sleeping in the context of vcpu's is extremely bad (eg virtio-block blocks in write() throttling which kills performance). It should wait on IO completions instead (qemu-kvm.c creates a pthread waitqueue to resolve that issue). Other than that looks fine to me, will give it a try. FWIW, I'm not getting wonderful results in KVM. It's hard to tell though because time seems wildly inaccurate (even with kvm clock in the guest). The time issue appears unrelated to this set of patches. Regards, Anthony Liguori - This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
Re: [kvm-devel] [PATCH 3/3] Implement linux-aio backend
On Fri, Apr 18, 2008 at 10:18:33AM -0500, Anthony Liguori wrote: Sleeping in the context of vcpu's is extremely bad (eg virtio-block blocks in write() throttling which kills performance). It should wait on IO completions instead (qemu-kvm.c creates a pthread waitqueue to resolve that issue). Other than that looks fine to me, will give it a try. FWIW, I'm not getting wonderful results in KVM. It's hard to tell though because time seems wildly inaccurate (even with kvm clock in the guest). The time issue appears unrelated to this set of patches. Oh, you won't get completion signals on the aio eventfd. You might want to try the select-with-timeout() stuff. Will submit that with proper signalfd emulation shortly. - This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel