Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 Oct 2015 05:33:31 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r288690 - stable/10/sys/kern
Message-ID:  <201510050533.t955XVa8029932@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Mon Oct  5 05:33:30 2015
New Revision: 288690
URL: https://svnweb.freebsd.org/changeset/base/288690

Log:
  MFC r288068:
  Ensure that maxproc does not exceed pid_max, at the time of boot.

Modified:
  stable/10/sys/kern/subr_param.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/kern/subr_param.c
==============================================================================
--- stable/10/sys/kern/subr_param.c	Mon Oct  5 05:24:16 2015	(r288689)
+++ stable/10/sys/kern/subr_param.c	Mon Oct  5 05:33:30 2015	(r288690)
@@ -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);
@@ -261,6 +261,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;
 
 	/*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201510050533.t955XVa8029932>