summaryrefslogtreecommitdiffstats
path: root/sys/ufs/ffs/ffs_vfsops.c
diff options
context:
space:
mode:
authormckusick <mckusick@FreeBSD.org>2015-05-28 00:11:36 +0000
committermckusick <mckusick@FreeBSD.org>2015-05-28 00:11:36 +0000
commitc94542bef304f991c0684e8a88dbcae364da6342 (patch)
treeb4a35f5f10df4eaba01126a2ffe3ce3bacd636f7 /sys/ufs/ffs/ffs_vfsops.c
parente12c5d1ed6e67d05e92e7300d4b38cff76215ae7 (diff)
downloadFreeBSD-src-c94542bef304f991c0684e8a88dbcae364da6342.zip
FreeBSD-src-c94542bef304f991c0684e8a88dbcae364da6342.tar.gz
MFC of 269533:
Limit the number of cylinder groups that will be searched when trying to build a cluster. The limit is tunable using the sysctl vfs.ffs.maxclustersearch. The current limit is 10 cylinder groups per block allocation. It was previously limited to the number of cylinder groups in the filesystem per block allocation. When there were no clusters of the needed size left, it repeatedly searched the whole filesystem for a non-existent cluster on every block allocation. The result was very slow filesystem allocation with 100% CPU utilization. The old behavior can be had by setting vfs.ffs.maxclustersearch to a huge number (1,000,000). This change affects only the layout policy routines so is not able to interfere with the integrity of the filesystem. Reported by: Dmitry Sivachenko (demon@) Tested by: Dmitry Sivachenko (demon@)
Diffstat (limited to 'sys/ufs/ffs/ffs_vfsops.c')
-rw-r--r--sys/ufs/ffs/ffs_vfsops.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c
index c0b6c9f..a7ed993 100644
--- a/sys/ufs/ffs/ffs_vfsops.c
+++ b/sys/ufs/ffs/ffs_vfsops.c
@@ -1687,6 +1687,7 @@ ffs_vgetf(mp, ino, flags, vpp, ffs_flags)
ip->i_dev = dev;
ip->i_number = ino;
ip->i_ea_refs = 0;
+ ip->i_nextclustercg = -1;
#ifdef QUOTA
{
int i;
OpenPOWER on IntegriCloud