> * When sync(2) is called. Though I am not 100% sure if we really want to do a
> cache flush for every sync. Thoughts?
We definately cannot it there. The system call is asyncronous, and
makes no gaurantees. Furthermore note that any user can call sync(2),
so unknown performance would come under control of any user.
Note the manual page declares this is a BUG, but it actually isn't.
This was by design. Yes, it is a pretty old unix wart
BUGS
sync() may return before the buffers are completely flushed.