Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Aug 2012 21:32:03 +0000 (UTC)
From:      Navdeep Parhar <np@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r239624 - head/sys/kern
Message-ID:  <201208232132.q7NLW38a098252@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: np
Date: Thu Aug 23 21:32:02 2012
New Revision: 239624
URL: http://svn.freebsd.org/changeset/base/239624

Log:
  Allow nmbjumbop, nmbjumbo9, and nmbjumbo16 to be set directly via loader
  tunables.
  
  MFC after:	1 month

Modified:
  head/sys/kern/kern_mbuf.c

Modified: head/sys/kern/kern_mbuf.c
==============================================================================
--- head/sys/kern/kern_mbuf.c	Thu Aug 23 21:31:52 2012	(r239623)
+++ head/sys/kern/kern_mbuf.c	Thu Aug 23 21:32:02 2012	(r239624)
@@ -110,14 +110,23 @@ struct mbstat mbstat;
 static void
 tunable_mbinit(void *dummy)
 {
-	TUNABLE_INT_FETCH("kern.ipc.nmbclusters", &nmbclusters);
 
 	/* This has to be done before VM init. */
+	TUNABLE_INT_FETCH("kern.ipc.nmbclusters", &nmbclusters);
 	if (nmbclusters == 0)
 		nmbclusters = 1024 + maxusers * 64;
-	nmbjumbop = nmbclusters / 2;
-	nmbjumbo9 = nmbjumbop / 2;
-	nmbjumbo16 = nmbjumbo9 / 2;
+
+	TUNABLE_INT_FETCH("kern.ipc.nmbjumbop", &nmbjumbop);
+	if (nmbjumbop == 0)
+		nmbjumbop = nmbclusters / 2;
+
+	TUNABLE_INT_FETCH("kern.ipc.nmbjumbo9", &nmbjumbo9);
+	if (nmbjumbo9 == 0)
+		nmbjumbo9 = nmbclusters / 4;
+
+	TUNABLE_INT_FETCH("kern.ipc.nmbjumbo16", &nmbjumbo16);
+	if (nmbjumbo16 == 0)
+		nmbjumbo16 = nmbclusters / 8;
 }
 SYSINIT(tunable_mbinit, SI_SUB_TUNABLES, SI_ORDER_MIDDLE, tunable_mbinit, NULL);
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201208232132.q7NLW38a098252>