Date: Thu, 21 Sep 2000 12:00:32 -0700 (PDT) From: Archie Cobbs <archie@whistle.com> To: Soren Schmidt <sos@freebsd.dk> Cc: mbendiks@eunet.no, terry@lambert.org, fs@freebsd.org Subject: Re: disable write caching with softupdates? Message-ID: <200009211900.MAA18117@bubba.whistle.com> In-Reply-To: <200009211820.UAA40830@freebsd.dk> "from Soren Schmidt at Sep 21, 2000 08:20:07 pm"
next in thread | previous in thread | raw e-mail | index | archive | help
Soren Schmidt writes: > > Thanks.. I was talking about a sysctl patch, where you could > > turn write caching on or off at any time while the system is > > running via sysctl. Is it even possible to do that? > > Why on earth would you want this as a sysctl knob ? > Either you want to play it safe, or you dont care, this is not > something you change your mind about now and then.... OK, here's an example. You have an /etc/rc script that checks at startup what kind of disk you have (eg "dmesg | grep -q QUANTUM") and for certain disk types that are known to lie about their write guarantees enables or disables write caching as appropriate. FYI I can confirm what Terry said that few disks we've encountered guarantee atomic sector writes in the face of power failure (i.e., leading to a corrupted/lost sector), much less flushing the entire write cache, so IMHO the answer to.. > I'm planning to make it a compile time option, the question > is what the default should be... ..is clearly "disabled" -- and then "enable at your own risk if you know that your disk doesn't lie (or don't care)". > The _right_ solution of cause is to have the FS code pass down > a flag that says only write this when all preceeding bufs are > on the media, now _that_ would be nice and work for both ATA > and SCSI devices.... Agreed, this is the best solution. I think it is necessary in order to make the promise of softupdates really rigorous. What we do on the InterJet right now is detect a power failure and, if detected, freeze the system immediately. This guarantees that the disk won't write a corrupted sector (because our power supply has 80ms or so of residual power -- enough for the disk to finish writing). Disabling write caching guarantees that the sectors believed to be written by soft-updates actually are when the system freezes. BOTH guarantees are necessary in order to guarantee a valid disk. -Archie ___________________________________________________________________________ Archie Cobbs * Whistle Communications, Inc. * http://www.whistle.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-fs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200009211900.MAA18117>