]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Severe slowdowns have been reported when creating or removing many
authormckusick <mckusick@FreeBSD.org>
Fri, 7 May 1999 02:26:47 +0000 (02:26 +0000)
committermckusick <mckusick@FreeBSD.org>
Fri, 7 May 1999 02:26:47 +0000 (02:26 +0000)
commit1a318ee963ce4ba8bd34629abfd04b5a1e69c7e6
tree99667645d51d1d34411ab9925b3e13f5e6adfdd8
parentb1c24e47cf445b208ca4b0c11f66015e0d8af795
Severe slowdowns have been reported when creating or removing many
files at once on a filesystem running soft updates. The root of
the problem is that soft updates limits the amount of memory that
may be allocated to dependency structures so as to avoid hogging
kernel memory. The original algorithm just waited for the disk I/O
to catch up and reduce the number of dependencies. This new code
takes a much more aggressive approach. Basically there are two
resources that routinely hit the limit. Inode dependencies during
periods with a high file creation rate and file and block removal
dependencies during periods with a high file removal rate. I have
attacked these problems from two fronts. When the inode dependency
limits are reached, I pick a random inode dependency, UFS_UPDATE
it together with all the other dirty inodes contained within its
disk block and then write that disk block. This trick usually
clears 5-50 inode dependencies in a single disk I/O. For block and
file removal dependencies, I pick a random directory page that has
at least one remove pending and VOP_FSYNC its directory. That
releases all its removal dependencies to the work queue. To further
hasten things along, I also immediately start the work queue process
rather than waiting for its next one second scheduled run.
contrib/sys/softupdates/ffs_softdep.c
sys/contrib/softupdates/ffs_softdep.c
sys/ufs/ffs/ffs_softdep.c