Async I/O
Async I/O
Posted Apr 10, 2009 4:53 UTC (Fri) by butlerm (subscriber, #13312)In reply to: Async I/O by bojan
Parent article: Linux Storage and Filesystem workshop, day 1
be doing already. There is a relatively simple solution to this that I
have mentioned a few times that is applicable to virtually any journalled
filesystem that has none of the performance cost of falling back to
data=ordered mode every time someone wants to do a rename replacement.
That is what ext4 (and apparently XFS) do in data=writeback mode when
rename safety is enabled - force all the data for the file to be renamed to
disk before the next metadata transaction can complete. That means that
*every* outstanding fsync operation is delayed while your multi-gigabyte
ISO file finishes being committed to disk.
This solution, as it turns out, is very similar to the practice of keeping
tilde files. It is just that the filesystem does it automatically and
invisibly, restoring the old version on recovery whenever the new version
didn't finish getting committed to disk. No threads, signal handlers, etc.
required. No problems with multiple process access. No application level
code to figure out whether a version is corrupt. No browser freeze ups.
Rename undo is the way to avoid all that, with little or no performance
cost.
