summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_mbuf.c
diff options
context:
space:
mode:
authorbz <bz@FreeBSD.org>2008-12-10 22:17:09 +0000
committerbz <bz@FreeBSD.org>2008-12-10 22:17:09 +0000
commitf30a0a94fe04dfbd42fcd3337a2bed2f65bd9c4c (patch)
tree952d5bb051eb37b9133d900d2b5919f5f34e2a4d /sys/kern/kern_mbuf.c
parent72852bcf842b4aad7df7cf9e728893cf1f1c979f (diff)
downloadFreeBSD-src-f30a0a94fe04dfbd42fcd3337a2bed2f65bd9c4c.zip
FreeBSD-src-f30a0a94fe04dfbd42fcd3337a2bed2f65bd9c4c.tar.gz
Make sure nmbclusters are initialized before maxsockets
by running the tunable_mbinit() SYSINIT at SI_ORDER_MIDDLE before the init_maxsockets() SYSINT at SI_ORDER_ANY. Reviewed by: rwatson, zec Sponsored by: The FreeBSD Foundation MFC after: 4 weeks
Diffstat (limited to 'sys/kern/kern_mbuf.c')
-rw-r--r--sys/kern/kern_mbuf.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/kern/kern_mbuf.c b/sys/kern/kern_mbuf.c
index 8cc8def..03581a4 100644
--- a/sys/kern/kern_mbuf.c
+++ b/sys/kern/kern_mbuf.c
@@ -101,6 +101,11 @@ int nmbjumbo9; /* limits number of 9k jumbo clusters */
int nmbjumbo16; /* limits number of 16k jumbo clusters */
struct mbstat mbstat;
+/*
+ * tunable_mbinit() has to be run before init_maxsockets() thus
+ * the SYSINIT order below is SI_ORDER_MIDDLE while init_maxsockets()
+ * runs at SI_ORDER_ANY.
+ */
static void
tunable_mbinit(void *dummy)
{
@@ -113,7 +118,7 @@ tunable_mbinit(void *dummy)
nmbjumbo9 = nmbjumbop / 2;
nmbjumbo16 = nmbjumbo9 / 2;
}
-SYSINIT(tunable_mbinit, SI_SUB_TUNABLES, SI_ORDER_ANY, tunable_mbinit, NULL);
+SYSINIT(tunable_mbinit, SI_SUB_TUNABLES, SI_ORDER_MIDDLE, tunable_mbinit, NULL);
/* XXX: These should be tuneables. Can't change UMA limits on the fly. */
static int
OpenPOWER on IntegriCloud