Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 Mar 2003 01:04:33 -0500
From:      Tom Rhodes <trhodes@FreeBSD.org>
To:        FreeBSD-audit@FreeBSD.org
Subject:   [PATCH] Review Requested
Message-ID:  <20030318010433.7e2adea1.trhodes@FreeBSD.org>

next in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.

--Multipart_Tue__18_Mar_2003_01:04:33_-0500_08284c00
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

What does the -audit readers think of the following patch?

--
Tom Rhodes


Index: kern/vfs_mount.c
===================================================================
RCS file: /home/ncvs/src/sys/kern/vfs_mount.c,v
retrieving revision 1.103
diff -u -r1.103 vfs_mount.c
--- kern/vfs_mount.c	22 Feb 2003 05:01:12 -0000	1.103
+++ kern/vfs_mount.c	17 Mar 2003 11:57:59 -0000
@@ -105,7 +105,8 @@
 static void	gets(char *cp);
 
 static int	usermount = 0;	/* if 1, non-root can mount fs. */
-SYSCTL_INT(_vfs, OID_AUTO, usermount, CTLFLAG_RW, &usermount, 0, "");
+SYSCTL_INT(_vfs, OID_AUTO, usermount, CTLFLAG_RW, &usermount, 0,
+    "Enable non-superuser mount privilege");
 
 MALLOC_DEFINE(M_MOUNT, "mount", "vfs mount structure");
 
Index: kern/vfs_subr.c
===================================================================
RCS file: /home/ncvs/src/sys/kern/vfs_subr.c,v
retrieving revision 1.435
diff -u -r1.435 vfs_subr.c
--- kern/vfs_subr.c	6 Mar 2003 03:41:01 -0000	1.435
+++ kern/vfs_subr.c	17 Mar 2003 12:16:29 -0000
@@ -90,7 +90,8 @@
  */
 static unsigned long	numvnodes;
 
-SYSCTL_LONG(_vfs, OID_AUTO, numvnodes, CTLFLAG_RD, &numvnodes, 0, "");
+SYSCTL_LONG(_vfs, OID_AUTO, numvnodes, CTLFLAG_RD, &numvnodes, 0,
+    "Number of vnodes in existence");
 
 /*
  * Conversion tables for conversion from vnode types to inode formats
@@ -115,10 +116,12 @@
  * getnewvnode() will return a newly allocated vnode.
  */
 static u_long wantfreevnodes = 25;
-SYSCTL_LONG(_vfs, OID_AUTO, wantfreevnodes, CTLFLAG_RW,
&wantfreevnodes, 0, "");
+SYSCTL_LONG(_vfs, OID_AUTO, wantfreevnodes, CTLFLAG_RW,
&wantfreevnodes, 0,
+    "Minimum count of free vnodes");
 /* Number of vnodes in the free list. */
 static u_long freevnodes;
-SYSCTL_LONG(_vfs, OID_AUTO, freevnodes, CTLFLAG_RD, &freevnodes, 0,
"");
+SYSCTL_LONG(_vfs, OID_AUTO, freevnodes, CTLFLAG_RD, &freevnodes, 0,
+    "Number of vnodes in the free list");
 
 /*
  * Various variables used for debugging the new implementation of
@@ -205,11 +208,14 @@
 static int syncer_maxdelay = SYNCER_MAXDELAY;	/* maximum delay time */
 static int syncdelay = 30;		/* max time to delay syncing data */
 static int filedelay = 30;		/* time to delay syncing files */
-SYSCTL_INT(_kern, OID_AUTO, filedelay, CTLFLAG_RW, &filedelay, 0, "");
+SYSCTL_INT(_kern, OID_AUTO, filedelay, CTLFLAG_RW, &filedelay, 0,
+    "File synchornization delay in seconds");
 static int dirdelay = 29;		/* time to delay syncing directories */
-SYSCTL_INT(_kern, OID_AUTO, dirdelay, CTLFLAG_RW, &dirdelay, 0, "");
+SYSCTL_INT(_kern, OID_AUTO, dirdelay, CTLFLAG_RW, &dirdelay, 0,
+    "Directory synchronization delay in seconds");
 static int metadelay = 28;		/* time to delay syncing metadata */
-SYSCTL_INT(_kern, OID_AUTO, metadelay, CTLFLAG_RW, &metadelay, 0, "");
+SYSCTL_INT(_kern, OID_AUTO, metadelay, CTLFLAG_RW, &metadelay, 0,
+    "File system meta-data synchronization delay");
 static int rushjob;		/* number of slots to run ASAP */
 static int stat_rush_requests;	/* number of times I/O speeded up */
 SYSCTL_INT(_debug, OID_AUTO, rush_requests, CTLFLAG_RW,
&stat_rush_requests, 0, "");
@@ -595,7 +601,8 @@
 
 static int timestamp_precision = TSP_SEC;
 SYSCTL_INT(_vfs, OID_AUTO, timestamp_precision, CTLFLAG_RW,
-    &timestamp_precision, 0, "");
+    &timestamp_precision, 0,
+    "Precision control of file timestamps");
 
 /*
  * Get a current timestamp.
@@ -2331,7 +2338,8 @@
  */
 #ifdef DIAGNOSTIC
 static int busyprt = 0;		/* print out busy vnodes */
-SYSCTL_INT(_debug, OID_AUTO, busyprt, CTLFLAG_RW, &busyprt, 0, "");
+SYSCTL_INT(_debug, OID_AUTO, busyprt, CTLFLAG_RW, &busyprt, 0,
+    "Print busy vnodes");
 #endif
 
 int
Index: ufs/ffs/ffs_alloc.c
===================================================================
RCS file: /home/ncvs/src/sys/ufs/ffs/ffs_alloc.c,v
retrieving revision 1.111
diff -u -r1.111 ffs_alloc.c
--- ufs/ffs/ffs_alloc.c	4 Mar 2003 00:04:43 -0000	1.111
+++ ufs/ffs/ffs_alloc.c	17 Mar 2003 12:32:00 -0000
@@ -371,10 +371,12 @@
 SYSCTL_NODE(_vfs, OID_AUTO, ffs, CTLFLAG_RW, 0, "FFS filesystem");
 
 static int doasyncfree = 1;
-SYSCTL_INT(_vfs_ffs, OID_AUTO, doasyncfree, CTLFLAG_RW, &doasyncfree,
0, "");
+SYSCTL_INT(_vfs_ffs, OID_AUTO, doasyncfree, CTLFLAG_RW, &doasyncfree,
0,
+    "Allow asynchronous writes");
 
 static int doreallocblks = 1;
-SYSCTL_INT(_vfs_ffs, OID_AUTO, doreallocblks, CTLFLAG_RW,
&doreallocblks, 0, "");
+SYSCTL_INT(_vfs_ffs, OID_AUTO, doreallocblks, CTLFLAG_RW,
&doreallocblks, 0,
+    "Enable block reallocation");
 
 #ifdef DEBUG
 static volatile int prtrealloc = 0;
Index: vm/vm_glue.c
===================================================================
RCS file: /home/ncvs/src/sys/vm/vm_glue.c,v
retrieving revision 1.163
diff -u -r1.163 vm_glue.c
--- vm/vm_glue.c	21 Jan 2003 11:34:57 -0000	1.163
+++ vm/vm_glue.c	17 Mar 2003 12:38:24 -0000
@@ -674,7 +674,8 @@
  */
 static int swap_idle_threshold1 = 2;
 SYSCTL_INT(_vm, OID_AUTO, swap_idle_threshold1,
-	CTLFLAG_RW, &swap_idle_threshold1, 0, "");
+	CTLFLAG_RW, &swap_idle_threshold1, 0,
+	"Guaranteed swapped in time for a process");
 
 /*
  * Swap_idle_threshold2 is the time that a process can be idle before
@@ -682,7 +683,8 @@
  */
 static int swap_idle_threshold2 = 10;
 SYSCTL_INT(_vm, OID_AUTO, swap_idle_threshold2,
-	CTLFLAG_RW, &swap_idle_threshold2, 0, "");
+	CTLFLAG_RW, &swap_idle_threshold2, 0,
+	"Time in idle seconds before a process will be swapped out");
 
 /*
  * Swapout is driven by the pageout daemon.  Very simple, we find
eligible
Index: vm/vm_mmap.c
===================================================================
RCS file: /home/ncvs/src/sys/vm/vm_mmap.c,v
retrieving revision 1.155
diff -u -r1.155 vm_mmap.c
--- vm/vm_mmap.c	13 Jan 2003 00:28:55 -0000	1.155
+++ vm/vm_mmap.c	17 Mar 2003 11:14:14 -0000
@@ -87,7 +87,8 @@
 #endif
 
 static int max_proc_mmap;
-SYSCTL_INT(_vm, OID_AUTO, max_proc_mmap, CTLFLAG_RW, &max_proc_mmap, 0,
"");
+SYSCTL_INT(_vm, OID_AUTO, max_proc_mmap, CTLFLAG_RW, &max_proc_mmap, 0,
+    "Maximum number of mmap()'ed spaces");
 
 /*
  * Set the maximum number of vm_map_entry structures per process. 
Roughly
Index: vm/vm_swap.c
===================================================================
RCS file: /home/ncvs/src/sys/vm/vm_swap.c,v
retrieving revision 1.133
diff -u -r1.133 vm_swap.c
--- vm/vm_swap.c	5 Mar 2003 23:50:15 -0000	1.133
+++ vm/vm_swap.c	17 Mar 2003 12:40:39 -0000
@@ -537,6 +537,6 @@
 }
 
 SYSCTL_INT(_vm, OID_AUTO, nswapdev, CTLFLAG_RD, &nswdev, 0,
-    "Number of swap devices");
+    "Maximum number of swap devices");
 SYSCTL_NODE(_vm, OID_AUTO, swap_info, CTLFLAG_RD, sysctl_vm_swap_info,
     "Swap statistics by device");
Index: vm/vm_zeroidle.c
===================================================================
RCS file: /home/ncvs/src/sys/vm/vm_zeroidle.c,v
retrieving revision 1.18
diff -u -r1.18 vm_zeroidle.c
--- vm/vm_zeroidle.c	12 Oct 2002 05:32:24 -0000	1.18
+++ vm/vm_zeroidle.c	17 Mar 2003 11:22:31 -0000
@@ -32,11 +32,13 @@
 	cnt_prezero, CTLFLAG_RD, &cnt_prezero, 0, "");
 
 static int idlezero_enable = 1;
-SYSCTL_INT(_vm, OID_AUTO, idlezero_enable, CTLFLAG_RW,
&idlezero_enable, 0, "");
+SYSCTL_INT(_vm, OID_AUTO, idlezero_enable, CTLFLAG_RW,
&idlezero_enable, 0,
+    "Enable/disable idle zeroing of pages");
 TUNABLE_INT("vm.idlezero_enable", &idlezero_enable);
 
 static int idlezero_maxrun = 16;
-SYSCTL_INT(_vm, OID_AUTO, idlezero_maxrun, CTLFLAG_RW,
&idlezero_maxrun, 0, "");
+SYSCTL_INT(_vm, OID_AUTO, idlezero_maxrun, CTLFLAG_RW,
&idlezero_maxrun, 0,
+    "Maximum iterations for idle zeroing of pages");
 TUNABLE_INT("vm.idlezero_maxrun", &idlezero_maxrun);
 
 /*


--Multipart_Tue__18_Mar_2003_01:04:33_-0500_08284c00
Content-Type: text/plain;
 name="tunables-desc.diff"
Content-Disposition: attachment;
 filename="tunables-desc.diff"
Content-Transfer-Encoding: 7bit

Index: kern/vfs_mount.c
===================================================================
RCS file: /home/ncvs/src/sys/kern/vfs_mount.c,v
retrieving revision 1.103
diff -u -r1.103 vfs_mount.c
--- kern/vfs_mount.c	22 Feb 2003 05:01:12 -0000	1.103
+++ kern/vfs_mount.c	17 Mar 2003 11:57:59 -0000
@@ -105,7 +105,8 @@
 static void	gets(char *cp);
 
 static int	usermount = 0;	/* if 1, non-root can mount fs. */
-SYSCTL_INT(_vfs, OID_AUTO, usermount, CTLFLAG_RW, &usermount, 0, "");
+SYSCTL_INT(_vfs, OID_AUTO, usermount, CTLFLAG_RW, &usermount, 0,
+    "Enable non-superuser mount privilege");
 
 MALLOC_DEFINE(M_MOUNT, "mount", "vfs mount structure");
 
Index: kern/vfs_subr.c
===================================================================
RCS file: /home/ncvs/src/sys/kern/vfs_subr.c,v
retrieving revision 1.435
diff -u -r1.435 vfs_subr.c
--- kern/vfs_subr.c	6 Mar 2003 03:41:01 -0000	1.435
+++ kern/vfs_subr.c	17 Mar 2003 12:16:29 -0000
@@ -90,7 +90,8 @@
  */
 static unsigned long	numvnodes;
 
-SYSCTL_LONG(_vfs, OID_AUTO, numvnodes, CTLFLAG_RD, &numvnodes, 0, "");
+SYSCTL_LONG(_vfs, OID_AUTO, numvnodes, CTLFLAG_RD, &numvnodes, 0,
+    "Number of vnodes in existence");
 
 /*
  * Conversion tables for conversion from vnode types to inode formats
@@ -115,10 +116,12 @@
  * getnewvnode() will return a newly allocated vnode.
  */
 static u_long wantfreevnodes = 25;
-SYSCTL_LONG(_vfs, OID_AUTO, wantfreevnodes, CTLFLAG_RW, &wantfreevnodes, 0, "");
+SYSCTL_LONG(_vfs, OID_AUTO, wantfreevnodes, CTLFLAG_RW, &wantfreevnodes, 0,
+    "Minimum count of free vnodes");
 /* Number of vnodes in the free list. */
 static u_long freevnodes;
-SYSCTL_LONG(_vfs, OID_AUTO, freevnodes, CTLFLAG_RD, &freevnodes, 0, "");
+SYSCTL_LONG(_vfs, OID_AUTO, freevnodes, CTLFLAG_RD, &freevnodes, 0,
+    "Number of vnodes in the free list");
 
 /*
  * Various variables used for debugging the new implementation of
@@ -205,11 +208,14 @@
 static int syncer_maxdelay = SYNCER_MAXDELAY;	/* maximum delay time */
 static int syncdelay = 30;		/* max time to delay syncing data */
 static int filedelay = 30;		/* time to delay syncing files */
-SYSCTL_INT(_kern, OID_AUTO, filedelay, CTLFLAG_RW, &filedelay, 0, "");
+SYSCTL_INT(_kern, OID_AUTO, filedelay, CTLFLAG_RW, &filedelay, 0,
+    "File synchornization delay in seconds");
 static int dirdelay = 29;		/* time to delay syncing directories */
-SYSCTL_INT(_kern, OID_AUTO, dirdelay, CTLFLAG_RW, &dirdelay, 0, "");
+SYSCTL_INT(_kern, OID_AUTO, dirdelay, CTLFLAG_RW, &dirdelay, 0,
+    "Directory synchronization delay in seconds");
 static int metadelay = 28;		/* time to delay syncing metadata */
-SYSCTL_INT(_kern, OID_AUTO, metadelay, CTLFLAG_RW, &metadelay, 0, "");
+SYSCTL_INT(_kern, OID_AUTO, metadelay, CTLFLAG_RW, &metadelay, 0,
+    "File system meta-data synchronization delay");
 static int rushjob;		/* number of slots to run ASAP */
 static int stat_rush_requests;	/* number of times I/O speeded up */
 SYSCTL_INT(_debug, OID_AUTO, rush_requests, CTLFLAG_RW, &stat_rush_requests, 0, "");
@@ -595,7 +601,8 @@
 
 static int timestamp_precision = TSP_SEC;
 SYSCTL_INT(_vfs, OID_AUTO, timestamp_precision, CTLFLAG_RW,
-    &timestamp_precision, 0, "");
+    &timestamp_precision, 0,
+    "Precision control of file timestamps");
 
 /*
  * Get a current timestamp.
@@ -2331,7 +2338,8 @@
  */
 #ifdef DIAGNOSTIC
 static int busyprt = 0;		/* print out busy vnodes */
-SYSCTL_INT(_debug, OID_AUTO, busyprt, CTLFLAG_RW, &busyprt, 0, "");
+SYSCTL_INT(_debug, OID_AUTO, busyprt, CTLFLAG_RW, &busyprt, 0,
+    "Print busy vnodes");
 #endif
 
 int
Index: ufs/ffs/ffs_alloc.c
===================================================================
RCS file: /home/ncvs/src/sys/ufs/ffs/ffs_alloc.c,v
retrieving revision 1.111
diff -u -r1.111 ffs_alloc.c
--- ufs/ffs/ffs_alloc.c	4 Mar 2003 00:04:43 -0000	1.111
+++ ufs/ffs/ffs_alloc.c	17 Mar 2003 12:32:00 -0000
@@ -371,10 +371,12 @@
 SYSCTL_NODE(_vfs, OID_AUTO, ffs, CTLFLAG_RW, 0, "FFS filesystem");
 
 static int doasyncfree = 1;
-SYSCTL_INT(_vfs_ffs, OID_AUTO, doasyncfree, CTLFLAG_RW, &doasyncfree, 0, "");
+SYSCTL_INT(_vfs_ffs, OID_AUTO, doasyncfree, CTLFLAG_RW, &doasyncfree, 0,
+    "Allow asynchronous writes");
 
 static int doreallocblks = 1;
-SYSCTL_INT(_vfs_ffs, OID_AUTO, doreallocblks, CTLFLAG_RW, &doreallocblks, 0, "");
+SYSCTL_INT(_vfs_ffs, OID_AUTO, doreallocblks, CTLFLAG_RW, &doreallocblks, 0,
+    "Enable block reallocation");
 
 #ifdef DEBUG
 static volatile int prtrealloc = 0;
Index: vm/vm_glue.c
===================================================================
RCS file: /home/ncvs/src/sys/vm/vm_glue.c,v
retrieving revision 1.163
diff -u -r1.163 vm_glue.c
--- vm/vm_glue.c	21 Jan 2003 11:34:57 -0000	1.163
+++ vm/vm_glue.c	17 Mar 2003 12:38:24 -0000
@@ -674,7 +674,8 @@
  */
 static int swap_idle_threshold1 = 2;
 SYSCTL_INT(_vm, OID_AUTO, swap_idle_threshold1,
-	CTLFLAG_RW, &swap_idle_threshold1, 0, "");
+	CTLFLAG_RW, &swap_idle_threshold1, 0,
+	"Guaranteed swapped in time for a process");
 
 /*
  * Swap_idle_threshold2 is the time that a process can be idle before
@@ -682,7 +683,8 @@
  */
 static int swap_idle_threshold2 = 10;
 SYSCTL_INT(_vm, OID_AUTO, swap_idle_threshold2,
-	CTLFLAG_RW, &swap_idle_threshold2, 0, "");
+	CTLFLAG_RW, &swap_idle_threshold2, 0,
+	"Time in idle seconds before a process will be swapped out");
 
 /*
  * Swapout is driven by the pageout daemon.  Very simple, we find eligible
Index: vm/vm_mmap.c
===================================================================
RCS file: /home/ncvs/src/sys/vm/vm_mmap.c,v
retrieving revision 1.155
diff -u -r1.155 vm_mmap.c
--- vm/vm_mmap.c	13 Jan 2003 00:28:55 -0000	1.155
+++ vm/vm_mmap.c	17 Mar 2003 11:14:14 -0000
@@ -87,7 +87,8 @@
 #endif
 
 static int max_proc_mmap;
-SYSCTL_INT(_vm, OID_AUTO, max_proc_mmap, CTLFLAG_RW, &max_proc_mmap, 0, "");
+SYSCTL_INT(_vm, OID_AUTO, max_proc_mmap, CTLFLAG_RW, &max_proc_mmap, 0,
+    "Maximum number of mmap()'ed spaces");
 
 /*
  * Set the maximum number of vm_map_entry structures per process.  Roughly
Index: vm/vm_swap.c
===================================================================
RCS file: /home/ncvs/src/sys/vm/vm_swap.c,v
retrieving revision 1.133
diff -u -r1.133 vm_swap.c
--- vm/vm_swap.c	5 Mar 2003 23:50:15 -0000	1.133
+++ vm/vm_swap.c	17 Mar 2003 12:40:39 -0000
@@ -537,6 +537,6 @@
 }
 
 SYSCTL_INT(_vm, OID_AUTO, nswapdev, CTLFLAG_RD, &nswdev, 0,
-    "Number of swap devices");
+    "Maximum number of swap devices");
 SYSCTL_NODE(_vm, OID_AUTO, swap_info, CTLFLAG_RD, sysctl_vm_swap_info,
     "Swap statistics by device");
Index: vm/vm_zeroidle.c
===================================================================
RCS file: /home/ncvs/src/sys/vm/vm_zeroidle.c,v
retrieving revision 1.18
diff -u -r1.18 vm_zeroidle.c
--- vm/vm_zeroidle.c	12 Oct 2002 05:32:24 -0000	1.18
+++ vm/vm_zeroidle.c	17 Mar 2003 11:22:31 -0000
@@ -32,11 +32,13 @@
 	cnt_prezero, CTLFLAG_RD, &cnt_prezero, 0, "");
 
 static int idlezero_enable = 1;
-SYSCTL_INT(_vm, OID_AUTO, idlezero_enable, CTLFLAG_RW, &idlezero_enable, 0, "");
+SYSCTL_INT(_vm, OID_AUTO, idlezero_enable, CTLFLAG_RW, &idlezero_enable, 0,
+    "Enable/disable idle zeroing of pages");
 TUNABLE_INT("vm.idlezero_enable", &idlezero_enable);
 
 static int idlezero_maxrun = 16;
-SYSCTL_INT(_vm, OID_AUTO, idlezero_maxrun, CTLFLAG_RW, &idlezero_maxrun, 0, "");
+SYSCTL_INT(_vm, OID_AUTO, idlezero_maxrun, CTLFLAG_RW, &idlezero_maxrun, 0,
+    "Maximum iterations for idle zeroing of pages");
 TUNABLE_INT("vm.idlezero_maxrun", &idlezero_maxrun);
 
 /*


--Multipart_Tue__18_Mar_2003_01:04:33_-0500_08284c00--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-audit" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030318010433.7e2adea1.trhodes>