[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC] Disk integrity in QEMU

From: Jens Axboe
Subject: Re: [Qemu-devel] [RFC] Disk integrity in QEMU
Date: Fri, 17 Oct 2008 15:20:41 +0200

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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]