From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KqpGk-0000sm-7i for qemu-devel@nongnu.org; Fri, 17 Oct 2008 09:21:30 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KqpGi-0000s8-OW for qemu-devel@nongnu.org; Fri, 17 Oct 2008 09:21:29 -0400 Received: from [199.232.76.173] (port=59984 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KqpGi-0000s5-Lq for qemu-devel@nongnu.org; Fri, 17 Oct 2008 09:21:28 -0400 Received: from pasmtpb.tele.dk ([80.160.77.98]:44142) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KqpGi-00006k-Bi for qemu-devel@nongnu.org; Fri, 17 Oct 2008 09:21:28 -0400 Date: Fri, 17 Oct 2008 15:20:41 +0200 From: Jens Axboe Subject: Re: [Qemu-devel] [RFC] Disk integrity in QEMU Message-ID: <20081017132040.GK19428@kernel.dk> References: <48EE38B9.2050106@codemonkey.ws> <48EF1D55.7060307@redhat.com> <48F0E83E.2000907@redhat.com> <48F10DFD.40505@codemonkey.ws> <48F1CD76.2000203@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <48F1CD76.2000203@redhat.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: Chris Wright , Mark McLoughlin , kvm-devel , Laurent Vivier , qemu-devel@nongnu.org, Ryan Harper On Sun, Oct 12 2008, Avi Kivity wrote: > >If you have a normal laptop, your disk has a cache. That cache does > >not have a battery backup. Under normal operations, the cache is > >acting in write-back mode and when you do a write, the disk will > >report the write as completed even though it is not actually on disk. > >If you really care about the data being on disk, you have to either > >use a disk with a battery backed cache (much more expensive) or enable > >write-through caching (will significantly reduce performance). > > > > I think that with SATA NCQ, this is no longer true. The drive will > report the write complete when it is on disk, and utilize multiple > outstanding requests to get coalescing and reordering. Not sure about It is still very true. Go buy any consumer drive on the market and check the write cache settings - hint, it's definitely shipped with write back caching. So while the drive may have NCQ and Linux will use it, the write cache is still using write back unless you explicitly change it. > this, though -- some drives may still be lying. I think this is largely an urban myth, at least I've never come across any drives that lie. It's easy enough to test, modulo firmware bugs. Just switch to write through and compare the random write iops rate. Or enable write barriers in Linux and do the same workload, compare iops rate again with write back caching. -- Jens Axboe