UNIX internals question
utzoo!decvax!watmath!dmmartindale
utzoo!decvax!watmath!dmmartindale
Thu Jan 14 22:45:31 AEST 1982
It probably isn't just because you are writing to a newly-mounted filesystem;
you're likely writing to a newly-allocated file on a newly-mounted filesystem
which has had its superblock rebuilt.
An icheck -s will happily set s_nfree in the superblock to 0, and the first
time an inode is allocated ialloc() must go out and read the i-list to find
100 (or whatever) new free inodes. Now, after using this algorithm for
a while, the first 1/4 (say) of the i-list becomes completely full.
In a good-sized filesystem, the i-list may be tens of cylinders, and
reading through several cylinders before finding the free inodes is what
causes the delay. Create 100 more files, and the 100th one will suffer
the same delay. In Berkeley UNIX, the problem was fixed by having ialloc
keep track of where it quit searching last time and start from there.
(It's actually more sophisticated, but this is the gist of the fix.)
More information about the Comp.unix.wizards
mailing list