aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Smith <msmith@FreeBSD.org>1999-01-15 17:24:05 +0000
committerMike Smith <msmith@FreeBSD.org>1999-01-15 17:24:05 +0000
commit8664a77199fa2b96ddc8610a4080ac440b601565 (patch)
treede9ba805af423d78d832b9e9bff8c5f008693224
parent419766671c864d4d2c690b83abd80241df9bbae3 (diff)
downloadsrc-8664a77199fa2b96ddc8610a4080ac440b601565.tar.gz
src-8664a77199fa2b96ddc8610a4080ac440b601565.zip
Fetch an overide for NMBCLUSTERS from the kernel environment. Never allow
the value to be reduced below that defined when the kernel was built.
Notes
Notes: svn path=/head/; revision=42705
-rw-r--r--sys/amd64/amd64/machdep.c8
-rw-r--r--sys/i386/i386/machdep.c8
2 files changed, 14 insertions, 2 deletions
diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c
index 2fed70512563..1bd6f6c5f04a 100644
--- a/sys/amd64/amd64/machdep.c
+++ b/sys/amd64/amd64/machdep.c
@@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)machdep.c 7.4 (Berkeley) 6/3/91
- * $Id: machdep.c,v 1.320 1999/01/06 23:05:36 julian Exp $
+ * $Id: machdep.c,v 1.321 1999/01/09 15:41:49 bde Exp $
*/
#include "apm.h"
@@ -410,6 +410,12 @@ again:
*/
{
vm_offset_t mb_map_size;
+ int xclusters;
+
+ /* Allow override of NMBCLUSTERS from the kernel environment */
+ if (getenv_int("kern.ipc.nmbclusters", &xclusters) &&
+ xclusters > nmbclusters)
+ nmbclusters = xclusters;
mb_map_size = nmbufs * MSIZE + nmbclusters * MCLBYTES;
mb_map_size = roundup2(mb_map_size, max(MCLBYTES, PAGE_SIZE));
diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c
index 2fed70512563..1bd6f6c5f04a 100644
--- a/sys/i386/i386/machdep.c
+++ b/sys/i386/i386/machdep.c
@@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)machdep.c 7.4 (Berkeley) 6/3/91
- * $Id: machdep.c,v 1.320 1999/01/06 23:05:36 julian Exp $
+ * $Id: machdep.c,v 1.321 1999/01/09 15:41:49 bde Exp $
*/
#include "apm.h"
@@ -410,6 +410,12 @@ again:
*/
{
vm_offset_t mb_map_size;
+ int xclusters;
+
+ /* Allow override of NMBCLUSTERS from the kernel environment */
+ if (getenv_int("kern.ipc.nmbclusters", &xclusters) &&
+ xclusters > nmbclusters)
+ nmbclusters = xclusters;
mb_map_size = nmbufs * MSIZE + nmbclusters * MCLBYTES;
mb_map_size = roundup2(mb_map_size, max(MCLBYTES, PAGE_SIZE));