From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JmsMQ-0007MB-Tq for qemu-devel@nongnu.org; Fri, 18 Apr 2008 11:18:46 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JmsMP-0007Iv-5s for qemu-devel@nongnu.org; Fri, 18 Apr 2008 11:18:46 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JmsMP-0007In-3j for qemu-devel@nongnu.org; Fri, 18 Apr 2008 11:18:45 -0400 Received: from e31.co.us.ibm.com ([32.97.110.149]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JmsMP-0007Mf-5C for qemu-devel@nongnu.org; Fri, 18 Apr 2008 11:18:45 -0400 Received: from d03relay02.boulder.ibm.com (d03relay02.boulder.ibm.com [9.17.195.227]) by e31.co.us.ibm.com (8.13.8/8.13.8) with ESMTP id m3IFIbee004945 for ; Fri, 18 Apr 2008 11:18:37 -0400 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d03relay02.boulder.ibm.com (8.13.8/8.13.8/NCO v8.7) with ESMTP id m3IFIbp4174710 for ; Fri, 18 Apr 2008 09:18:37 -0600 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m3IFIaBB021872 for ; Fri, 18 Apr 2008 09:18:37 -0600 Message-ID: <4808BBC9.6040502@us.ibm.com> Date: Fri, 18 Apr 2008 10:18:33 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <1208460412-27567-1-git-send-email-aliguori@us.ibm.com> <1208460412-27567-3-git-send-email-aliguori@us.ibm.com> <20080418150956.GB19341@dmt> In-Reply-To: <20080418150956.GB19341@dmt> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 3/3] Implement linux-aio backend Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Marcelo Tosatti Cc: kvm-devel@lists.sourceforge.net, qemu-devel@nongnu.org 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