summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_mbuf.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/kern_mbuf.c')
-rw-r--r--sys/kern/kern_mbuf.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/kern/kern_mbuf.c b/sys/kern/kern_mbuf.c
index de2998b..f8fd0d7 100644
--- a/sys/kern/kern_mbuf.c
+++ b/sys/kern/kern_mbuf.c
@@ -113,8 +113,17 @@ tunable_mbinit(void *dummy)
/* This has to be done before VM init. */
TUNABLE_INT_FETCH("kern.ipc.nmbclusters", &nmbclusters);
- if (nmbclusters == 0)
+ if (nmbclusters == 0) {
+#ifdef VM_AUTOTUNE_NMBCLUSTERS
+ nmbclusters = VM_AUTOTUNE_NMBCLUSTERS;
+#else
nmbclusters = 1024 + maxusers * 64;
+#endif
+#ifdef VM_MAX_AUTOTUNE_NMBCLUSTERS
+ if (nmbclusters > VM_MAX_AUTOTUNE_NMBCLUSTERS)
+ nmbclusters = VM_MAX_AUTOTUNE_NMBCLUSTERS;
+#endif
+ }
TUNABLE_INT_FETCH("kern.ipc.nmbjumbop", &nmbjumbop);
if (nmbjumbop == 0)
OpenPOWER on IntegriCloud