Subject: Re: write cache on ATA drives
To: Manuel Bouyer <bouyer@antioche.eu.org>
From: Thor Lancelot Simon <tls@rek.tjls.com>
List: tech-kern
Date: 12/05/2002 18:25:33
On Thu, Dec 05, 2002 at 11:58:07PM +0100, Manuel Bouyer wrote:
> On Thu, Dec 05, 2002 at 12:43:44PM -0500, Sean Davis wrote:
> > Hi, a friend of mine has told me that using a drive with write caching
> > enabled essentially negates any benefit of soft dependencies. I think I can
> > see the logic behind that, ie if the drive reorders writes... my question
> > is: how does one disable write cache on an ata drive? atactl does not seem
> > to know about enabling/disabling it.
> 
> There's no way to do that for now. I should really add dkctl support
> to wd.
> 
> However, I tried disabling write-back cache unconditinally a while ago,
> in completely killed performances.

What Windows does, evidently, is to disable and then re-enable write-back
caching as barriers around performing a synchronous I/O to the drive.  This
forces a cache flush, so you know the sync I/O went out, while letting the
drive continue to reorder async I/O to normal files, retaining much of the
performance benefit.  With softdep, you'd retain most of the rest -- as
much as you could _safely_ retain, anyway.