Re: [PATCH 5/7] vfs: Add wbcflush sysfs knob to disable storage device writeback cache flushes

Jeff Garzik
2009-03-30T22:02:44Z

Bartlomiej Zolnierkiewicz wrote:
> calling fsync() after every mail fetched. Adding mandatory cache flush
> to it only makes things worse (again looking from performance POV).
>
> BTW in Linux world we never made any guarantees for fsync() on devices
> using write caching:

Quite true, but I've always thought that was trading away correctness
for performance... at a critical juncture where a consistency
checkpoint was explicitly requested by the app.

My ideal would probably be blkdev cache flushing by default on fsync(2),
with a block layer "desktop mode" knob to turn it off if you don't want it.

The current alternatives -- mount sync or disable blkdev writeback cache
-- are far, far slower and punish the entire system just to provide a
consistency checkpoint for a handful of fsync-needful apps.

Jeff