diff options
author | peter <peter@FreeBSD.org> | 2001-07-26 23:08:31 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 2001-07-26 23:08:31 +0000 |
commit | 94613ac7dab9074f1f2e33d5a7552c510f1c4397 (patch) | |
tree | 1e4b04c47c6d07cb5f5a3354307ca1acf7cb4daa /sys/kern/subr_mbuf.c | |
parent | 1d4cc78f8dcca5c411d32fad62ffc681b0125e73 (diff) | |
download | FreeBSD-src-94613ac7dab9074f1f2e33d5a7552c510f1c4397.zip FreeBSD-src-94613ac7dab9074f1f2e33d5a7552c510f1c4397.tar.gz |
Use the tunable maxusers rather than the compile-time one. Evaluate and
initialize in the right order to make derivative settings work right.
eg: at compile time, nmbufs was double nmbclusters. For POLA this should
work the same at runtime.
Diffstat (limited to 'sys/kern/subr_mbuf.c')
-rw-r--r-- | sys/kern/subr_mbuf.c | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/sys/kern/subr_mbuf.c b/sys/kern/subr_mbuf.c index 8be31a0..72d07d8 100644 --- a/sys/kern/subr_mbuf.c +++ b/sys/kern/subr_mbuf.c @@ -143,25 +143,21 @@ struct mb_pcpu_list { * allocatable by the sfbuf allocator (found in uipc_syscalls.c) */ #ifndef NMBCLUSTERS -#define NMBCLUSTERS (1024 + MAXUSERS * 64) +#define NMBCLUSTERS (1024 + maxusers * 64) #endif #ifndef NMBUFS -#define NMBUFS (NMBCLUSTERS * 2) +#define NMBUFS (nmbclusters * 2) #endif #ifndef NSFBUFS -#define NSFBUFS (512 + MAXUSERS * 16) +#define NSFBUFS (512 + maxusers * 16) #endif #ifndef NMBCNTS -#define NMBCNTS (NMBCLUSTERS + NSFBUFS) +#define NMBCNTS (nmbclusters + nsfbufs) #endif -int nmbufs = NMBUFS; -int nmbclusters = NMBCLUSTERS; -int nmbcnt = NMBCNTS; -int nsfbufs = NSFBUFS; -TUNABLE_INT("kern.ipc.nmbufs", &nmbufs); -TUNABLE_INT("kern.ipc.nmbclusters", &nmbclusters); -TUNABLE_INT("kern.ipc.nmbcnt", &nmbcnt); -TUNABLE_INT("kern.ipc.nsfbufs", &nsfbufs); +int nmbufs; +int nmbclusters; +int nmbcnt; +int nsfbufs; /* * Perform sanity checks of tunables declared above. @@ -169,9 +165,19 @@ TUNABLE_INT("kern.ipc.nsfbufs", &nsfbufs); static void tunable_mbinit(void *dummy) { + /* * This has to be done before VM init. */ + nmbclusters = NMBCLUSTERS; + TUNABLE_INT_FETCH("kern.ipc.nmbclusters", &nmbclusters); + nmbufs = NMBUFS; + TUNABLE_INT_FETCH("kern.ipc.nmbufs", &nmbufs); + nsfbufs = NSFBUFS; + TUNABLE_INT_FETCH("kern.ipc.nsfbufs", &nsfbufs); + nmbcnt = NMBCNTS; + TUNABLE_INT_FETCH("kern.ipc.nmbcnt", &nmbcnt); + /* Sanity checks */ if (nmbufs < nmbclusters * 2) nmbufs = nmbclusters * 2; if (nmbcnt < nmbclusters + nsfbufs) |