Date: Thu, 20 Feb 1997 05:55:07 -0500 (EST) From: Peter Dufault <dufault@hda.com> To: asami@vader.cs.berkeley.edu (Satoshi Asami) Cc: joerg_wunsch@uriah.heep.sax.de, james@wgold.demon.co.uk, hackers@FreeBSD.org, dufault@hda.com Subject: Re: drive write caches Message-ID: <199702201055.FAA02640@hda.hda.com> In-Reply-To: <199702200052.QAA00662@silvia.HIP.Berkeley.EDU> from Satoshi Asami at "Feb 19, 97 04:52:38 pm"
next in thread | previous in thread | raw e-mail | index | archive | help
> * > - if the OS tells me it has a successful write through the > * > disk device, can I rely on: > * > > * > a) the data is on the platter > * > * It is. Since physio(9) waits for the completion, you should be > * notified of any lower-level errors. Note that this is _unlike_ with > * the block devices, where writing happens asynchronously, so the kernel > * did already declare the write operation as successful by the time it > * notices an error. > > Really? I think drives have their own cache, and if they have write > buffering turned on, they will happily return "write complete" when > they are only holding data in the buffer. This is the deferred error that you can get a system console message about - it means there was an error for a transfer that already returned a successful completion. I believe the way to handle this properly is to issue a SYNCHRONIZE CACHE command at the right place and then handle any deferred errors that come back as a result. This would require putting a hook in the file system code someplace to do that sync / fixup. The page to turn it off is the caching page (page 8): # Caching page: 0x08 { {Reserved} *t5 {WCE} t1 {MF} t1 {RCD} t1 {Demand Retention Priority} t4 {Write Retention Priority} t4 {Disable Pre-fetch Transfer Length} i2 {Minumum Pre-fetch} i2 {Maximum Pre-fetch} i2 {Maximum Pre-fetch Ceiling} i2 } WCE is write cache enable. I've just checked and two of my disks (from Rodney, Rod, if you're out there) have the write cache disabled. Peter -- Peter Dufault (dufault@hda.com) Realtime Machine Control and Simulation HD Associates, Inc. Voice: 508 433 6936
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199702201055.FAA02640>