mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-02 12:20:51 +00:00
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
This commit is contained in:
parent
32812b6ea5
commit
cddc961a83
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=8747
@ -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 <sys/param.h>
|
||||
@ -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' */
|
||||
|
||||
/*
|
||||
|
@ -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 <sys/param.h>
|
||||
@ -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' */
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user