summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2002-01-25 02:30:28 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2002-01-25 02:30:28 +0000
commit20a8b5f710ad7693bb65d0016ff45aa621034b05 (patch)
tree87b7f390dc7784e085e09e554574f954759fa0d6 /sys
parent3f0da7d78d4a6e9b1cb2bb01b3c0a6290195b3ed (diff)
Move softdep sysctls from debug to vfs.ffs; art@ OK
Diffstat (limited to 'sys')
-rw-r--r--sys/ufs/ffs/ffs_extern.h28
-rw-r--r--sys/ufs/ffs/ffs_softdep.c18
-rw-r--r--sys/ufs/ffs/ffs_vfsops.c34
3 files changed, 60 insertions, 20 deletions
diff --git a/sys/ufs/ffs/ffs_extern.h b/sys/ufs/ffs/ffs_extern.h
index 15eb204efd3..7c83ee9576c 100644
--- a/sys/ufs/ffs/ffs_extern.h
+++ b/sys/ufs/ffs/ffs_extern.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ffs_extern.h,v 1.17 2001/12/19 08:58:07 art Exp $ */
+/* $OpenBSD: ffs_extern.h,v 1.18 2002/01/25 02:30:26 millert Exp $ */
/* $NetBSD: ffs_extern.h,v 1.4 1996/02/09 22:22:22 christos Exp $ */
/*-
@@ -40,7 +40,19 @@
#define FFS_CLUSTERWRITE 2 /* cluster writing enabled */
#define FFS_REALLOCBLKS 3 /* block reallocation enabled */
#define FFS_ASYNCFREE 4 /* asynchronous block freeing enabled */
-#define FFS_MAXID 5 /* number of valid ffs ids */
+#define FFS_MAX_SOFTDEPS 5 /* maximum structs before slowdown */
+#define FFS_SD_TICKDELAY 6 /* ticks to pause during slowdown */
+#define FFS_SD_WORKLIST_PUSH 7 /* # of worklist cleanups */
+#define FFS_SD_BLK_LIMIT_PUSH 8 /* # of times block limit neared */
+#define FFS_SD_INO_LIMIT_PUSH 9 /* # of times inode limit neared */
+#define FFS_SD_BLK_LIMIT_HIT 10 /* # of times block slowdown imposed */
+#define FFS_SD_INO_LIMIT_HIT 11 /* # of times inode slowdown imposed */
+#define FFS_SD_SYNC_LIMIT_HIT 12 /* # of synchronous slowdowns imposed */
+#define FFS_SD_INDIR_BLK_PTRS 13 /* bufs redirtied as indir ptrs not written */
+#define FFS_SD_INODE_BITMAP 14 /* bufs redirtied as inode bitmap not written */
+#define FFS_SD_DIRECT_BLK_PTRS 15 /* bufs redirtied as direct ptrs not written */
+#define FFS_SD_DIR_ENTRY 16 /* bufs redirtied as dir entry cannot write */
+#define FFS_MAXID 17 /* number of valid ffs ids */
#define FFS_NAMES { \
{ 0, 0 }, \
@@ -48,6 +60,18 @@
{ "doclusterwrite", CTLTYPE_INT }, \
{ "doreallocblks", CTLTYPE_INT }, \
{ "doasyncfree", CTLTYPE_INT }, \
+ { "max_softdeps", CTLTYPE_INT }, \
+ { "sd_tickdelay", CTLTYPE_INT }, \
+ { "sd_worklist_push", CTLTYPE_INT }, \
+ { "sd_blk_limit_push", CTLTYPE_INT }, \
+ { "sd_ino_limit_push", CTLTYPE_INT }, \
+ { "sd_blk_limit_hit", CTLTYPE_INT }, \
+ { "sd_ino_limit_hit", CTLTYPE_INT }, \
+ { "sd_sync_limit_hit", CTLTYPE_INT }, \
+ { "sd_indir_blk_ptrs", CTLTYPE_INT }, \
+ { "sd_inode_bitmap", CTLTYPE_INT }, \
+ { "sd_direct_blk_ptrs", CTLTYPE_INT }, \
+ { "sd_dir_entry", CTLTYPE_INT }, \
}
diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c
index ec73a6e5b65..a44fe9d1688 100644
--- a/sys/ufs/ffs/ffs_softdep.c
+++ b/sys/ufs/ffs/ffs_softdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ffs_softdep.c,v 1.33 2002/01/24 21:42:24 mickey Exp $ */
+/* $OpenBSD: ffs_softdep.c,v 1.34 2002/01/25 02:30:26 millert Exp $ */
/*
* Copyright 1998, 2000 Marshall Kirk McKusick. All Rights Reserved.
*
@@ -559,22 +559,6 @@ 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 <uvm/uvm_extern.h>
-#include <sys/sysctl.h>
-struct ctldebug debug20 = { "max_softdeps", &max_softdeps };
-struct ctldebug debug21 = { "tickdelay", &tickdelay };
-struct ctldebug debug22 = { "worklist_push", &stat_worklist_push };
-struct ctldebug debug23 = { "blk_limit_push", &stat_blk_limit_push };
-struct ctldebug debug24 = { "ino_limit_push", &stat_ino_limit_push };
-struct ctldebug debug25 = { "blk_limit_hit", &stat_blk_limit_hit };
-struct ctldebug debug26 = { "ino_limit_hit", &stat_ino_limit_hit };
-struct ctldebug debug27 = { "sync_limit_hit", &stat_sync_limit_hit };
-struct ctldebug debug28 = { "indir_blk_ptrs", &stat_indir_blk_ptrs };
-struct ctldebug debug29 = { "inode_bitmap", &stat_inode_bitmap };
-struct ctldebug debug30 = { "direct_blk_ptrs", &stat_direct_blk_ptrs };
-struct ctldebug debug31 = { "dir_entry", &stat_dir_entry };
-#endif /* DEBUG */
/*
* Add an item to the end of the work queue.
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c
index 4fd34932ec3..f4374c79bec 100644
--- a/sys/ufs/ffs/ffs_vfsops.c
+++ b/sys/ufs/ffs/ffs_vfsops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ffs_vfsops.c,v 1.49 2002/01/23 00:39:48 art Exp $ */
+/* $OpenBSD: ffs_vfsops.c,v 1.50 2002/01/25 02:30:27 millert Exp $ */
/* $NetBSD: ffs_vfsops.c,v 1.19 1996/02/09 22:22:26 christos Exp $ */
/*
@@ -1344,6 +1344,12 @@ ffs_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
struct proc *p;
{
extern int doclusterread, doclusterwrite, doreallocblks, doasyncfree;
+#ifdef FFS_SOFTUPDATES
+ extern int max_softdeps, tickdelay, stat_worklist_push;
+ extern int stat_blk_limit_push, stat_ino_limit_push, stat_blk_limit_hit;
+ extern int stat_ino_limit_hit, stat_sync_limit_hit, stat_indir_blk_ptrs;
+ extern int stat_inode_bitmap, stat_direct_blk_ptrs, stat_dir_entry;
+#endif
/* all sysctl names at this level are terminal */
if (namelen != 1)
@@ -1361,6 +1367,32 @@ ffs_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
&doreallocblks));
case FFS_ASYNCFREE:
return (sysctl_int(oldp, oldlenp, newp, newlen, &doasyncfree));
+#ifdef FFS_SOFTUPDATES
+ case FFS_MAX_SOFTDEPS:
+ return (sysctl_int(oldp, oldlenp, newp, newlen, &max_softdeps));
+ case FFS_SD_TICKDELAY:
+ return (sysctl_int(oldp, oldlenp, newp, newlen, &tickdelay));
+ case FFS_SD_WORKLIST_PUSH:
+ return (sysctl_rdint(oldp, oldlenp, newp, stat_worklist_push));
+ case FFS_SD_BLK_LIMIT_PUSH:
+ return (sysctl_rdint(oldp, oldlenp, newp, stat_blk_limit_push));
+ case FFS_SD_INO_LIMIT_PUSH:
+ return (sysctl_rdint(oldp, oldlenp, newp, stat_ino_limit_push));
+ case FFS_SD_BLK_LIMIT_HIT:
+ return (sysctl_rdint(oldp, oldlenp, newp, stat_blk_limit_hit));
+ case FFS_SD_INO_LIMIT_HIT:
+ return (sysctl_rdint(oldp, oldlenp, newp, stat_ino_limit_hit));
+ case FFS_SD_SYNC_LIMIT_HIT:
+ return (sysctl_rdint(oldp, oldlenp, newp, stat_sync_limit_hit));
+ case FFS_SD_INDIR_BLK_PTRS:
+ return (sysctl_rdint(oldp, oldlenp, newp, stat_indir_blk_ptrs));
+ case FFS_SD_INODE_BITMAP:
+ return (sysctl_rdint(oldp, oldlenp, newp, stat_inode_bitmap));
+ case FFS_SD_DIRECT_BLK_PTRS:
+ return (sysctl_rdint(oldp, oldlenp, newp, stat_direct_blk_ptrs));
+ case FFS_SD_DIR_ENTRY:
+ return (sysctl_rdint(oldp, oldlenp, newp, stat_dir_entry));
+#endif
default:
return (EOPNOTSUPP);
}