Date: Mon, 7 Sep 2009 13:58:27 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org Subject: svn commit: r196925 - in stable/6/sys: . conf contrib/pf dev/cxgb ufs/ffs Message-ID: <200909071358.n87DwRYP016560@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Mon Sep 7 13:58:26 2009 New Revision: 196925 URL: http://svn.freebsd.org/changeset/base/196925 Log: MFC r196206. Take the number of allocated freeblks into consideration for softdep_slowdown(). Tested by: pluknet gmail com Modified: stable/6/sys/ (props changed) stable/6/sys/conf/ (props changed) stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) stable/6/sys/ufs/ffs/ffs_softdep.c Modified: stable/6/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- stable/6/sys/ufs/ffs/ffs_softdep.c Mon Sep 7 13:37:04 2009 (r196924) +++ stable/6/sys/ufs/ffs/ffs_softdep.c Mon Sep 7 13:58:26 2009 (r196925) @@ -668,6 +668,8 @@ static int req_clear_inodedeps; /* synce static int req_clear_remove; /* syncer process flush some freeblks */ #define FLUSH_REMOVE 2 #define FLUSH_REMOVE_WAIT 3 +static long num_freeblkdep; /* number of freeblks workitems allocated */ + /* * runtime statistics */ @@ -2195,6 +2197,9 @@ softdep_setup_freeblocks(ip, length, fla freeblks->fb_uid = ip->i_uid; freeblks->fb_previousinum = ip->i_number; freeblks->fb_devvp = ip->i_devvp; + ACQUIRE_LOCK(&lk); + num_freeblkdep++; + FREE_LOCK(&lk); extblocks = 0; if (fs->fs_magic == FS_UFS2_MAGIC) extblocks = btodb(fragroundup(fs, ip->i_din2->di_extsize)); @@ -2784,6 +2789,7 @@ handle_workitem_freeblocks(freeblks, fla ACQUIRE_LOCK(&lk); WORKITEM_FREE(freeblks, D_FREEBLKS); + num_freeblkdep--; FREE_LOCK(&lk); } @@ -5708,7 +5714,8 @@ softdep_slowdown(vp) max_softdeps_hard = max_softdeps * 11 / 10; if (num_dirrem < max_softdeps_hard / 2 && num_inodedep < max_softdeps_hard && - VFSTOUFS(vp->v_mount)->um_numindirdeps < maxindirdeps) { + VFSTOUFS(vp->v_mount)->um_numindirdeps < maxindirdeps && + num_freeblkdep < max_softdeps_hard) { FREE_LOCK(&lk); return (0); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200909071358.n87DwRYP016560>