summaryrefslogtreecommitdiffstats
path: root/sys/sys
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2009-03-09 19:35:20 +0000
committerjhb <jhb@FreeBSD.org>2009-03-09 19:35:20 +0000
commit80d9458a56d4f116af5709e969c6178012c2c0c5 (patch)
treefa5afa97f873f392e028df96bcfc150033e0a387 /sys/sys
parentbf8b9802a6f18a57e942003c695f03173d6947d8 (diff)
downloadFreeBSD-src-80d9458a56d4f116af5709e969c6178012c2c0c5.zip
FreeBSD-src-80d9458a56d4f116af5709e969c6178012c2c0c5.tar.gz
Adjust some variables (mostly related to the buffer cache) that hold
address space sizes to be longs instead of ints. Specifically, the follow values are now longs: runningbufspace, bufspace, maxbufspace, bufmallocspace, maxbufmallocspace, lobufspace, hibufspace, lorunningspace, hirunningspace, maxswzone, maxbcache, and maxpipekva. Previously, a relatively small number (~ 44000) of buffers set in kern.nbuf would result in integer overflows resulting either in hangs or bogus values of hidirtybuffers and lodirtybuffers. Now one has to overflow a long to see such problems. There was a check for a nbuf setting that would cause overflows in the auto-tuning of nbuf. I've changed it to always check and cap nbuf but warn if a user-supplied tunable would cause overflow. Note that this changes the ABI of several sysctls that are used by things like top(1), etc., so any MFC would probably require a some gross shims to allow for that. MFC after: 1 month
Diffstat (limited to 'sys/sys')
-rw-r--r--sys/sys/buf.h8
-rw-r--r--sys/sys/pipe.h2
2 files changed, 5 insertions, 5 deletions
diff --git a/sys/sys/buf.h b/sys/sys/buf.h
index e05b20c..7c3dd4e 100644
--- a/sys/sys/buf.h
+++ b/sys/sys/buf.h
@@ -446,10 +446,10 @@ buf_countdeps(struct buf *bp, int i)
#ifdef _KERNEL
extern int nbuf; /* The number of buffer headers */
-extern int maxswzone; /* Max KVA for swap structures */
-extern int maxbcache; /* Max KVA for buffer cache */
-extern int runningbufspace;
-extern int hibufspace;
+extern long maxswzone; /* Max KVA for swap structures */
+extern long maxbcache; /* Max KVA for buffer cache */
+extern long runningbufspace;
+extern long hibufspace;
extern int dirtybufthresh;
extern int bdwriteskip;
extern int dirtybufferflushes;
diff --git a/sys/sys/pipe.h b/sys/sys/pipe.h
index 2371b2a..86c884a 100644
--- a/sys/sys/pipe.h
+++ b/sys/sys/pipe.h
@@ -56,7 +56,7 @@
/*
* See sys_pipe.c for info on what these limits mean.
*/
-extern int maxpipekva;
+extern u_long maxpipekva;
/*
* Pipe buffer information.
OpenPOWER on IntegriCloud