Journalling FS and Soft Updates comparision
bde at zeta.org.au
Fri Feb 11 04:39:20 PST 2005
On Thu, 10 Feb 2005, Julian Elischer wrote:
> uh.. isn't this backwards?
> Dan Nelson wrote:
> >This is the big drawback to softupdates for me. You run the risk of
> >losing the last `sysctl kern.metadelay` seconds worth of files, because
> >of all the state that softupdates keeps in RAM.
> kern.filedelay: 30
> kern.dirdelay: 29
> kern.metadelay: 28
> according to this we write the metadata first and then the directory
> block and
> then the file data..
The kern.metadata sysctl has nothing to do with the delay for syncing
metadata, unlike what its comment says. It controls the delay for
syncing files of type VCHR. Since these files have no data to sync,
only metadata can be synced for them. In -current and mostly in
RELENG_5, since phk has completed or almost completed axing support
for device files outside of devfs, these files usually have nothing
The kern.filedelay sysctl contrils the delay for syncing files of type VDIR
(directories) and the kern.filedelay sysctl controls the delay for syncing
files of type VREG (regular files).
> This is just wrong. In softupdates you want to have your data down
> before you do
> your metadata write, and you need to have your directory block written
> last of all.
Hopefully this (and correct order for metadata) is controlled by
dependencies. The syncer alone can't control the order since files
may be synced asynchronously relative to the syncer via fsync(2) or
for recycling vnodes, etc.
> When I committed the softupdates code for Kirk, I think that the numbers
> data in 10 seconds, metadata in 15 and directory block in 20.
> (from memory).
That commit (vfs_subr.c 1.201, etc.) is hard to find and understand because
it was a mega-commit with no details (not even the keyowrd "soft") in its
log message. It has only syncer_maxdelay = 32 and syncer_delay = 30, and
some magic scaling of these. The current numbers were added in rev.1.201.
It is easy to see what the old scaling was in the diff for that:
syncdelay / 2 -> dirdelay (default 15 -> 29)
syncdelay / 3 -> metadelay ( 10 -> 28)
sycdelay -> filedelay ( 30 -> 30)
So the numbers have been bunched up but not reordered.
More information about the freebsd-fs