tech-kern archive

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

Re: Disabling disk caches [Re: CVS commit: src/lib/libc/sys, re sync(1)]

On Mar 26, 2009, at 11:52 AM, David Holland wrote:

On Wed, Mar 25, 2009 at 09:44:52PM +0000, Andrew Doran wrote:
I think we should:

(a) Automatically disable the disk write cache the moment a file system is mounted on the disk, unless that file system is known to handle caching. For our purposes, that leaves logging ffs and zfs (and whatever other
   modern file systems come along) with the cache enabled.

While technically this may be the right thing, it won't be popular.

(So, why doesn't sync flush the disk write cache?)

Apple went though this exercise a while back and was beaten to a pulp over slow performance for apps that used fsync().

So now Mac OS X has the F_FULLFSYNC fcntl command which is "fsync() + flush the disk cache". Apps that require such semantics use it directly.

(b) Change mount to flush the disk cache as a test, if r/w mount. If we get an error, send a warning message to the log. This will help us to get
   broken disk drivers fixed.

That seems like a good idea.

David A. Holland

-- thorpej

Home | Main Index | Thread Index | Old Index