fsync(2) and on-disk write-back cache

Martin Cracauer cracauer at cons.org
Mon Aug 30 22:58:43 UTC 2010


I always assumed the answer to this question is "of course":

When doing an fsync (waiting for the commit), do we actually tell the
disk to flush the on-disk write-back cache (if that is in use) to the
platters?

I just went down some code paths in both FreeBSD and Linux and in both
cases the paths for fsync quickly disappear in the generic
block-by-block flushing code that is also used for regular (non-fsync)
flushing.  I didn't see anything aware of the on-disk cache.

Martin
-- 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Martin Cracauer <cracauer at cons.org>   http://www.cons.org/cracauer/


More information about the freebsd-fs mailing list