svn commit: r241468 - stable/9/sys/kern

Navdeep Parhar np at FreeBSD.org
Thu Oct 11 23:02:35 UTC 2012


Author: np
Date: Thu Oct 11 23:02:35 2012
New Revision: 241468
URL: http://svn.freebsd.org/changeset/base/241468

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

Modified:
  stable/9/sys/kern/kern_mbuf.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/kern/kern_mbuf.c
==============================================================================
--- stable/9/sys/kern/kern_mbuf.c	Thu Oct 11 22:46:20 2012	(r241467)
+++ stable/9/sys/kern/kern_mbuf.c	Thu Oct 11 23:02:35 2012	(r241468)
@@ -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);
 


More information about the svn-src-all mailing list