From cddc961a83150be3713544bd1aa1bd5d94776f15 Mon Sep 17 00:00:00 2001 From: David Greenman Date: Thu, 25 May 1995 07:36:24 +0000 Subject: [PATCH] Made "NMBCLUSTERS" calculation dynamic and fixed bogus use of "NMBCLUSTERS" in machdep.c (it should use the global nmbclusters). Moved the calculation of nmbclusters into conf/param.c (same place where nmbclusters has always been assigned), and made the calculation include an extra amount based on "maxusers". NMBCLUSTERS can still be overrided in the kernel config file as always, but this change will make that generally unnecessary. This fixes the "bug" reports from people who have misconfigured kernels seeing the network "hang" when the mbuf cluster pool runs out. Reviewed by: John Dyson --- sys/conf/param.c | 15 +++++++++++++-- sys/kern/subr_param.c | 15 +++++++++++++-- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/sys/conf/param.c b/sys/conf/param.c index aa2a18f2203..aef43749c65 100644 --- a/sys/conf/param.c +++ b/sys/conf/param.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)param.c 8.2 (Berkeley) 1/21/94 - * $Id: param.c,v 1.7 1995/02/16 11:29:19 joerg Exp $ + * $Id: param.c,v 1.8 1995/02/20 19:42:19 guido Exp $ */ #include @@ -84,9 +84,20 @@ struct timezone tz = { TIMEZONE, DST }; int maxproc = NPROC; /* maximum # of processes */ int maxprocperuid = NPROC-1; /* maximum # of processes per user */ int maxfiles = NPROC*2; /* system wide open files limit */ -int maxfilesperproc = NPROC*2; /* system wide open files limit */ +int maxfilesperproc = NPROC*2; /* per-process open files limit */ int ncallout = 16 + NPROC; /* maximum # of timer events */ + +/* maximum # of mbuf clusters */ +#ifndef NMBCLUSTERS +#ifdef GATEWAY +int nmbclusters = 512 + MAXUSERS * 16; +#else +int nmbclusters = 256 + MAXUSERS * 16; +#endif /* GATEWAY */ +#else int nmbclusters = NMBCLUSTERS; +#endif + int fscale = FSCALE; /* kernel uses `FSCALE', user uses `fscale' */ /* diff --git a/sys/kern/subr_param.c b/sys/kern/subr_param.c index aa2a18f2203..aef43749c65 100644 --- a/sys/kern/subr_param.c +++ b/sys/kern/subr_param.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)param.c 8.2 (Berkeley) 1/21/94 - * $Id: param.c,v 1.7 1995/02/16 11:29:19 joerg Exp $ + * $Id: param.c,v 1.8 1995/02/20 19:42:19 guido Exp $ */ #include @@ -84,9 +84,20 @@ struct timezone tz = { TIMEZONE, DST }; int maxproc = NPROC; /* maximum # of processes */ int maxprocperuid = NPROC-1; /* maximum # of processes per user */ int maxfiles = NPROC*2; /* system wide open files limit */ -int maxfilesperproc = NPROC*2; /* system wide open files limit */ +int maxfilesperproc = NPROC*2; /* per-process open files limit */ int ncallout = 16 + NPROC; /* maximum # of timer events */ + +/* maximum # of mbuf clusters */ +#ifndef NMBCLUSTERS +#ifdef GATEWAY +int nmbclusters = 512 + MAXUSERS * 16; +#else +int nmbclusters = 256 + MAXUSERS * 16; +#endif /* GATEWAY */ +#else int nmbclusters = NMBCLUSTERS; +#endif + int fscale = FSCALE; /* kernel uses `FSCALE', user uses `fscale' */ /*