summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authoralfred <alfred@FreeBSD.org>2012-10-25 01:46:20 +0000
committeralfred <alfred@FreeBSD.org>2012-10-25 01:46:20 +0000
commit2873c69678a60205a65535b0db107be3ca3fc38a (patch)
treee2b3008d95d20a1cf37d643eec227912a6b4fb56 /sys/kern
parente56b4fdc17b3d9d906ac2a1a1fe90da82c774712 (diff)
downloadFreeBSD-src-2873c69678a60205a65535b0db107be3ca3fc38a.zip
FreeBSD-src-2873c69678a60205a65535b0db107be3ca3fc38a.tar.gz
Allow autotune maxusers > 384 on 64 bit machines
A default install on large memory machines with multiple 10gigE interfaces were not being given enough mbufs to do full bandwidth TCP or NFS traffic. To keep the value somewhat reasonable, we scale back the number of maxuers by 1/6 past the 384 point. This gives us enough mbufs for most of our pretty basic 10gigE line-speed tests to complete.
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/subr_param.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/kern/subr_param.c b/sys/kern/subr_param.c
index c5c1868..5c9af32 100644
--- a/sys/kern/subr_param.c
+++ b/sys/kern/subr_param.c
@@ -278,8 +278,16 @@ init_param2(long physpages)
maxusers = physpages / (2 * 1024 * 1024 / PAGE_SIZE);
if (maxusers < 32)
maxusers = 32;
- if (maxusers > 384)
- maxusers = 384;
+ /*
+ * Clips maxusers to 384 on machines with <= 4GB RAM or 32bit.
+ * Scales it down 6x for large memory machines.
+ */
+ if (maxusers > 384) {
+ if (sizeof(void *) <= 4)
+ maxusers = 384;
+ else
+ maxusers = 384 + ((maxusers - 384) / 6);
+ }
}
/*
OpenPOWER on IntegriCloud