Ensure that maxproc does not exceed pid_max, at the time of boot.
Changes to kern.pid_max mib after the boot can break this relation. The maxfiles value was calculated by the MAXFILES formula based on maxproc value, but this change decouples them, and MAXFILES now references maxusers. Without manual tuning, the maxfiles default value remains as it was prior to this commit. But for systems which have tuned maxproc and rely on maxfiles to adjust, additional reconfiguration is needed. Reported by: rwatson Reviewed by: emaste Sponsored by: The FreeBSD Foundation MFC after: 2 weeks
This commit is contained in:
parent
8153ec9ad5
commit
1f57d8c66b
@ -76,7 +76,7 @@ __FBSDID("$FreeBSD$");
|
||||
#define NBUF 0
|
||||
#endif
|
||||
#ifndef MAXFILES
|
||||
#define MAXFILES (maxproc * 2)
|
||||
#define MAXFILES (40 + 32 * maxusers)
|
||||
#endif
|
||||
|
||||
static int sysctl_kern_vm_guest(SYSCTL_HANDLER_ARGS);
|
||||
@ -253,6 +253,8 @@ init_param2(long physpages)
|
||||
TUNABLE_INT_FETCH("kern.maxproc", &maxproc);
|
||||
if (maxproc > (physpages / 12))
|
||||
maxproc = physpages / 12;
|
||||
if (maxproc > pid_max)
|
||||
maxproc = pid_max;
|
||||
maxprocperuid = (maxproc * 9) / 10;
|
||||
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user