Allow the kern.maxusers boot tuneable to be set to 0 (previously only

the kernel config's maxusers could be set to 0 for autosizing to work).
Reviewed by:	rwatson, imp
MFC after:	3 days
This commit is contained in:
Matthew Dillon 2002-02-06 01:19:19 +00:00
parent 1c71deff79
commit 0b94a0e9f9

View File

@ -133,14 +133,15 @@ init_param2(int physpages)
{
/* Base parameters */
if ((maxusers = MAXUSERS) == 0) {
maxusers = MAXUSERS;
TUNABLE_INT_FETCH("kern.maxusers", &maxusers);
if (maxusers == 0) {
maxusers = physpages / (2 * 1024 * 1024 / PAGE_SIZE);
if (maxusers < 32)
maxusers = 32;
if (maxusers > 384)
maxusers = 384;
}
TUNABLE_INT_FETCH("kern.maxusers", &maxusers);
/*
* The following can be overridden after boot via sysctl. Note: