From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: bad O_DIRECT read and write performance with small block sizes with virtio Date: Tue, 03 Aug 2010 19:14:10 +0300 Message-ID: <4C584052.3030102@redhat.com> References: <1280769301.11871.10.camel@dogen> <4C570470.9000803@codemonkey.ws> <1280846424.13790.26.camel@dogen> <4C582B55.2030209@redhat.com> <1280847471.13790.55.camel@dogen> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Stefan Hajnoczi , kvm@vger.kernel.org, Anthony Liguori To: John Leach Return-path: Received: from mx1.redhat.com ([209.132.183.28]:18242 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756404Ab0HCQOO (ORCPT ); Tue, 3 Aug 2010 12:14:14 -0400 In-Reply-To: <1280847471.13790.55.camel@dogen> Sender: kvm-owner@vger.kernel.org List-ID: On 08/03/2010 05:57 PM, John Leach wrote: > On Tue, 2010-08-03 at 17:44 +0300, Avi Kivity wrote: >> On 08/03/2010 05:40 PM, John Leach wrote: >>> dd if=/dev/mapper/zero of=/dev/null bs=8k count=1000000 iflag=direct >>> 8192000000 bytes (8.2 GB) copied, 3.46529 s, 2.4 GB/s >>> >>> dd if=/dev/mapper/zero of=/dev/null bs=8k count=1000000 >>> 8192000000 bytes (8.2 GB) copied, 5.5741 s, 1.5 GB/s >>> >>> dd is just using read. >>> >> What's /dev/mapper/zero? A real volume or a zero target? >> > zero target: > > echo "0 21474836480 zero" | dmsetup create zero > > The same performance penalty occurs when using real disks though, I just > moved to a zero target to rule out the variables of spinning metal and > raid controller caches. Don't, it's confusing things. I'd expect dd to be slower with iflag=direct since the kernel can't do readahead an instead must roundtrip to the controller. With a zero target it's faster since it doesn't have to roundtrip and instead avoids a copy. -- error compiling committee.c: too many arguments to function