From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: linux-aio usable? Date: Mon, 08 Mar 2010 10:28:15 -0600 Message-ID: <4B95259F.7060505@codemonkey.ws> References: <4B94BF05.20609@redhat.com> <20100308094801.GA24943@schleppi.birkenwald.de> <4B94C806.9000209@redhat.com> <4B95091D.4020307@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Dustin Kirkland , Bernhard Schmidt , kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from mail-ew0-f216.google.com ([209.85.219.216]:35310 "EHLO mail-ew0-f216.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754434Ab0CHQ2d (ORCPT ); Mon, 8 Mar 2010 11:28:33 -0500 Received: by ewy8 with SMTP id 8so199646ewy.28 for ; Mon, 08 Mar 2010 08:28:31 -0800 (PST) In-Reply-To: <4B95091D.4020307@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 03/08/2010 08:26 AM, Avi Kivity wrote: > On 03/08/2010 04:25 PM, Dustin Kirkland wrote: >> On Mon, Mar 8, 2010 at 3:48 AM, Avi Kivity wrote: >>> On 03/08/2010 11:48 AM, Bernhard Schmidt wrote: >>>> On Mon, Mar 08, 2010 at 11:10:29AM +0200, Avi Kivity wrote: >>>>>> Are there any potential pitfalls? >>>>> It won't work well unless running on a block device (partition or >>>>> LVM). >>>> What does "work well" mean in this context? Potential dataloss? >>> No, it becomes synchronous (=extra slow). >> But for this to happen, the user would have had to consciously enter >> into the situation by creating/using a non block device, >> non-pre-allocated backing disk AND specify the aio=native option, >> correct? >> > > I thought there was some autodetection involved, but perhaps I just > imagined it. There's no autodetection. linux-aio support in the kernel downgrades to synchronous IO if the underlying storage does not support linux-aio. There is no indication to userspace that this has happened. If this happens, besides having a slow guest, the guest VCPU will be starved during the I/O requests potentially resulting in things like soft lockups and time drift. Generally, speaking, linux-aio will work well under the following circumstances: - cache=off is specified - the underlying file system is XFS or you are using a block device We cannot detect this reliably though so it's really up to the user to decide whether to use it. We're working on improving the linux-aio kernel interface though to eliminate this detectability problem after which, we can enable it in a more automatic fashion. Regards, Anthony Liguori