fsync(2) manual and hdd write caching

Bruce Cran bruce at cran.org.uk
Wed Oct 27 10:11:30 UTC 2010


On Wed, 27 Oct 2010 02:00:51 -0700
perryh at pluto.rain.com wrote:

> Short of mounting synchronously, with the attendant performance
> hit, would it not make sense for fsync(2) to issue ATA_FLUSHCACHE
> or SCSI "SYNCHRONIZE CACHE" after it has finished writing data
> to the drive?  Surely the low-level capability to issue those
> commands must already exist, else we would have no way to safely
> prepare for power off.

mounting synchronously won't help, will it? As I understand it that
just makes sure that data is sent straight to disk and not left in
memory; the data will still be stored in the HDD cache for a
while.

-- 
Bruce Cran


More information about the freebsd-hackers mailing list