summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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