summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2005-05-03 11:03:29 +0000
committerjeff <jeff@FreeBSD.org>2005-05-03 11:03:29 +0000
commitdde0e2eb941b89fa05f92a49c943c4406db19d72 (patch)
tree269f60862ab3ce1b2004a901d1987b90269c18b6 /sys
parent79452537e3d4c5c4604a6dca1bf4ec4264e376c7 (diff)
downloadFreeBSD-src-dde0e2eb941b89fa05f92a49c943c4406db19d72.zip
FreeBSD-src-dde0e2eb941b89fa05f92a49c943c4406db19d72.tar.gz
- Don't restrict the softdep stats to DEBUG kernels, they cost nothing to
export. This was happening anyway since this file manually sets DEBUG. - Add a sysctl for the number of items on the worklist. - Use a more canonical loop restart in softdep_fsync_mountdev, it saves some code at the expense of a goto and makes me worry less about modifying a variable that should be private to the TAILQ_FOREACH_SAFE macro.
Diffstat (limited to 'sys')
-rw-r--r--sys/ufs/ffs/ffs_softdep.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c
index 00e63b0..023c21b 100644
--- a/sys/ufs/ffs/ffs_softdep.c
+++ b/sys/ufs/ffs/ffs_softdep.c
@@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$");
#include <sys/mutex.h>
#include <sys/proc.h>
#include <sys/stat.h>
+#include <sys/sysctl.h>
#include <sys/syslog.h>
#include <sys/vnode.h>
#include <sys/conf.h>
@@ -76,6 +77,8 @@ __FBSDID("$FreeBSD$");
#include <ufs/ffs/ffs_extern.h>
#include <ufs/ufs/ufs_extern.h>
+#include <vm/vm.h>
+
#include "opt_ffs.h"
#ifndef SOFTUPDATES
@@ -593,9 +596,7 @@ static int stat_indir_blk_ptrs; /* bufs redirtied as indir ptrs not written */
static int stat_inode_bitmap; /* bufs redirtied as inode bitmap not written */
static int stat_direct_blk_ptrs;/* bufs redirtied as direct ptrs not written */
static int stat_dir_entry; /* bufs redirtied as dir entry cannot write */
-#ifdef DEBUG
-#include <vm/vm.h>
-#include <sys/sysctl.h>
+
SYSCTL_INT(_debug, OID_AUTO, max_softdeps, CTLFLAG_RW, &max_softdeps, 0, "");
SYSCTL_INT(_debug, OID_AUTO, tickdelay, CTLFLAG_RW, &tickdelay, 0, "");
SYSCTL_INT(_debug, OID_AUTO, maxindirdeps, CTLFLAG_RW, &maxindirdeps, 0, "");
@@ -609,7 +610,7 @@ SYSCTL_INT(_debug, OID_AUTO, indir_blk_ptrs, CTLFLAG_RW, &stat_indir_blk_ptrs, 0
SYSCTL_INT(_debug, OID_AUTO, inode_bitmap, CTLFLAG_RW, &stat_inode_bitmap, 0, "");
SYSCTL_INT(_debug, OID_AUTO, direct_blk_ptrs, CTLFLAG_RW, &stat_direct_blk_ptrs, 0, "");
SYSCTL_INT(_debug, OID_AUTO, dir_entry, CTLFLAG_RW, &stat_dir_entry, 0, "");
-#endif /* DEBUG */
+SYSCTL_INT(_debug, OID_AUTO, worklist_num, CTLFLAG_RD, &num_on_worklist, 0, "");
SYSCTL_DECL(_vfs_ffs);
@@ -4906,6 +4907,7 @@ softdep_fsync_mountdev(vp)
if (!vn_isdisk(vp, NULL))
panic("softdep_fsync_mountdev: vnode not a disk");
+restart:
ACQUIRE_LOCK(&lk);
VI_LOCK(vp);
TAILQ_FOREACH_SAFE(bp, &vp->v_bufobj.bo_dirty.bv_hd, b_bobufs, nbp) {
@@ -4931,13 +4933,7 @@ softdep_fsync_mountdev(vp)
FREE_LOCK(&lk);
bremfree(bp);
(void) bawrite(bp);
- ACQUIRE_LOCK(&lk);
- /*
- * Since we may have slept during the I/O, we need
- * to start from a known point.
- */
- VI_LOCK(vp);
- nbp = TAILQ_FIRST(&vp->v_bufobj.bo_dirty.bv_hd);
+ goto restart;
}
FREE_LOCK(&lk);
drain_output(vp);
OpenPOWER on IntegriCloud