Operation
Soft updates allow only asynchronous metadata writes that do not render the on-disk file system inconsistent, or that the only inconsistency that ever happens is a storage space leak (space marked allocated when not used by any file). It avoids having to do ordered synchronous metadata writes by temporarily "rolling back" any part of a metadata block that depends on another potentially non-flushed or partially rolled-back block when writing it.
In effect, blocks may be flushed at any time and the soft-update code will always provide the disk a consistent version of it (as long as it knows which blocks have physically been flushed). Recovery then simply becomes a matter of running a background walk of the file system when it is next mounted to garbage collect any allocated space that has been orphaned. This also permits the filesystem to selectively flush certain files without having to flush all metadata blocks or all of the records.
Data that is unlinked from the metadata dependency graph before writing it to disk has begun does not need to be written to disk at all. For example, creating a file, using it for a short period of time, and then deleting it may cause no disk activity at all.
Soft Updates require periodic flushing of the metadata to nonvolatile storage.
In FreeBSD, the sysctl variables that control the delays between periodical data and metadata flushes to permanent storage (in seconds) are:
kern.filedelay: 30 kern.dirdelay: 29 kern.metadelay: 28The delays for file data, directory metadata, and file allocation metadata are different to avoid IO spikes.
Read more about this topic: Soft Updates
Famous quotes containing the word operation:
“It is critical vision alone which can mitigate the unimpeded operation of the automatic.”
—Marshall McLuhan (19111980)
“Human knowledge and human power meet in one; for where the cause is not known the effect cannot be produced. Nature to be commanded must be obeyed; and that which in contemplation is as the cause is in operation as the rule.”
—Francis Bacon (15601626)
“It requires a surgical operation to get a joke well into a Scotch understanding. The only idea of wit, or rather that inferior variety of the electric talent which prevails occasionally in the North, and which, under the name of Wut, is so infinitely distressing to people of good taste, is laughing immoderately at stated intervals.”
—Sydney Smith (17711845)