From: Antoine Martin Subject: Re: raw disks no longer work in latest kvm (kvm-88 was fine) Date: Sun, 23 May 2010 22:06:54 +0700 Message-ID: <4BF9448E.7080909@nagafix.co.uk> References: <4B92BF97.4040001@nagafix.co.uk> <4B932829.8090503@nagafix.co.uk> <4B9372B6.3050408@msgid.tls.msk.ru> <20100307100022.GA23201@infradead.org> <4B93A624.8010707@nagafix.co.uk> <4B93AF8A.3070805@nagafix.co.uk> <4B93C2F9.7030904@msgid.tls.msk.ru> <4B93DE3F.4090103@nagafix.co.uk> <4B93DFF0.5050905@redhat.com> <20100307172151.GA24859@infradead.org> <4B93E29E.6090609@redhat.com> <4B93E9EE.6020701@nagafix.co.uk> <4B93F4A4.9050003@redhat.com> <4B93F96E.30508@nagafix.co.uk> <4B93FA18.2090808@redhat.com> <4B93FAD8.9010207@nagafix.co.uk> <4B93FBC1.3000209@redhat.com> <4B93FD94.7060508@nagafix.co.uk> <4B93FFEE.4080007@redhat.com> <4B9B6008.4090902@nagafix.co.uk> <4BBE51F4.6070904@nagafix.co.uk> <4BF7B589.1070808@nagafix.co.uk> <4BF7BD33.2090700@msgid.tls.msk.ru> <4BF7C172.2000508@nagafix.co .uk> <4BF8ED0C.2070004@nagafix.co.uk> <4BF91844.8030903@redhat.com> <4BF936BB.5000401@nagafix.co.uk> <4BF9391A.1080302@redhat.com> <4BF93EF5.5090106@nagafix.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Michael Tokarev , Christoph Hellwig , kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from mamba.nagafix.co.uk ([194.145.196.68]:39401 "EHLO mail.nagafix.co.uk" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752865Ab0EWPHE (ORCPT ); Sun, 23 May 2010 11:07:04 -0400 In-Reply-To: <4BF93EF5.5090106@nagafix.co.uk> Sender: kvm-owner@vger.kernel.org List-ID: On 05/23/2010 09:43 PM, Antoine Martin wrote: > On 05/23/2010 09:18 PM, Avi Kivity wrote: >> On 05/23/2010 05:07 PM, Antoine Martin wrote: >>> On 05/23/2010 06:57 PM, Avi Kivity wrote: >>>> On 05/23/2010 11:53 AM, Antoine Martin wrote: >>>>> I'm not: 64-bit host and 64-bit guest. >>>>> Just to be sure, I've tested that patch and still no joy: >>>>> /dev/vdc: read failed after 0 of 512 at 0: Input/output error >>>>> /dev/vdc: read failed after 0 of 512 at 0: Input/output error >>>>> /dev/vdc: read failed after 0 of 2048 at 0: Input/output error >>>>> pread is still broken on this big raw disk. >>>>> >>>> >>>> Can you summarize your environment and reproducer again? The >>>> thread is so long it is difficult to understand exactly what you >>>> are testing. >>>> >>> Sure thing: >>> >>> Description of the problem: >>> A guest tries to mount a large raw partition (1.5TB /dev/sda9 in my >>> case), this fails with pread enabled, works with it disabled. >> >> Did you mean: preadv? > Yes, here's what makes it work ok (as suggested by Christoph earlier > in the thread) in posix-aio-compat.c: > #undef CONFIG_PREADV > #ifdef CONFIG_PREADV > static int preadv_present = 1; > #else > static int preadv_present = 0; > #endif >>> >>> What has been tested: >>> Host has had 2.6.31.x and now 2.6.34 - with no improvement. >>> Guest has had numerous kernel versions and patches applied for >>> testing (from 2.6.31.x to 2.6.34) - none made any difference. >>> (although the recent patch stopped the large partition from getting >>> corrupted by the merged requests bug.. yay!) >>> It was once thought that glibc needed to be rebuilt against newer >>> kernel headers, done that too, and rebuilt qemu-kvm afterwards. (was >>> 2.6.28 then 2.6.31 and now 2.6.33) >>> >>> What has been reported: straces, kernel error messages as above. >>> Here is the qemu command line (sanitized - removed the virtual disks >>> which work fine and network config): >>> qemu -clock dynticks -m 256 -L ./ -kernel ./bzImage-2.6.34-aio >>> -append "root=/dev/vda" -nographic -drive >>> file=/dev/sda9,if=virtio,cache=none >>> >>> Let me know if you need any other details. I can also arrange ssh >>> access to the system if needed. >> >> And: 64-bit host kernel, 64-bit host userspace, yes? > Yes. (and 64-bit guest/userspace too) >> >> Does aio=native help? > It does indeed! >> How about if=ide? > Will test with another kernel and report back (this one doesn't have > any non-virtio drivers) That also works fine. I guess this tells you that the problem is confined to raw-disk+virtio+aio-threaded I'm switching all my VMs to aio=native, but feel free to send patches if you want me to re-test aio=threaded Thanks Antoine