summaryrefslogtreecommitdiffstats
path: root/sys/kern/uipc_mbuf.c
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2001-06-13 00:36:41 +0000
committerpeter <peter@FreeBSD.org>2001-06-13 00:36:41 +0000
commita97b956712bad0390710581f86964ee6917b11e7 (patch)
treeddb24a251b3885ff1c399a77534c8b645a92ec34 /sys/kern/uipc_mbuf.c
parent61b8c1c1c868244cc97afa26e11bbf130081a604 (diff)
downloadFreeBSD-src-a97b956712bad0390710581f86964ee6917b11e7.zip
FreeBSD-src-a97b956712bad0390710581f86964ee6917b11e7.tar.gz
Patch up a blunder I made a few days ago. nmbcnt was being initialized
too late. Noted by: bmilekic Pointy-hat to: peter
Diffstat (limited to 'sys/kern/uipc_mbuf.c')
-rw-r--r--sys/kern/uipc_mbuf.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c
index b30975b..4134623 100644
--- a/sys/kern/uipc_mbuf.c
+++ b/sys/kern/uipc_mbuf.c
@@ -114,6 +114,21 @@ static void m_reclaim(void);
#define NMB_INIT 16
#define REF_INIT NMBCLUSTERS
+static void
+tunable_mbinit(void *dummy)
+{
+
+ /*
+ * Sanity checks and pre-initialization for non-constants.
+ * This has to be done before VM initialization.
+ */
+ if (nmbufs < nmbclusters * 2)
+ nmbufs = nmbclusters * 2;
+ if (nmbcnt == 0)
+ nmbcnt = EXT_COUNTERS;
+}
+SYSINIT(tunable_mbinit, SI_SUB_TUNABLES, SI_ORDER_ANY, tunable_mbinit, NULL);
+
/*
* Full mbuf subsystem initialization done here.
*
@@ -126,12 +141,6 @@ mbinit(void *dummy)
vm_offset_t maxaddr;
vm_size_t mb_map_size;
- /* Sanity checks and pre-initialization for non-constants */
- if (nmbufs < nmbclusters * 2)
- nmbufs = nmbclusters * 2;
- if (nmbcnt == 0)
- nmbcnt = EXT_COUNTERS;
-
/*
* Setup the mb_map, allocate requested VM space.
*/
OpenPOWER on IntegriCloud