ufs2 / softupdates / ZFS / disk write cache

Andrew Snow andrew at modulus.org
Sun Jun 21 11:45:18 UTC 2009


Dan Naumov wrote:
> Actually, if it is possible for ZFS to issue "flush the cache NOW"
> commands directly to disk every 5 seconds by default (value tunable) I
> see 2 potential options/changes that would make the life of
> "UFS2+softupdates on SATA disks" users a whole lot easier.

I believe you might be barking up the wrong tree here.

The issue with cache flushing is not that changes are written to disk - 
that happens anyway, eventually, even if you don't explicitly flush the 
cache.

The big issue is that things get written to disk in the correct order so 
that the system can recover from an unexpected crash.  Even if the cache 
gets flushed every 5 seconds, things on UFS could get still get 
corrupted between T=0 and 4.9s, if the system writes something and 
expects it to be written syncronously and it is isn't.

The only truly safe bet here is to turn disable the ATA write cache tunable.

Folks who need to maximize safety and can't afford the performance hit 
of no write cache need to do what they always have had to do in the past 
- buy a controller card with battery-backed cached.


- Andrew


More information about the freebsd-fs mailing list