From db957588c975ddb73c2cc76fbf2e5e4ecddbcd88 Mon Sep 17 00:00:00 2001 From: Peter Wemm Date: Wed, 13 Jun 2001 00:36:41 +0000 Subject: [PATCH] Patch up a blunder I made a few days ago. nmbcnt was being initialized too late. Noted by: bmilekic Pointy-hat to: peter --- sys/kern/uipc_mbuf.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c index b30975b6e93..4134623c5d7 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. */ -- 2.45.2