diff options
author | Jerry Jelinek <jerry.jelinek@joyent.com> | 2017-12-21 19:20:47 +0000 |
---|---|---|
committer | Jerry Jelinek <jerry.jelinek@joyent.com> | 2017-12-21 19:21:27 +0000 |
commit | 43b3bab58788e30af95d6dd211800182624ede96 (patch) | |
tree | 087cfdce53c448fbb2edbe1038d9a028bb07f146 /usr/src/uts/common/conf | |
parent | 50ba12892088bc014f9b26fd88cd7c8e97748cbb (diff) | |
download | illumos-joyent-43b3bab58788e30af95d6dd211800182624ede96.tar.gz |
OS-5726 bump pid max to a reasonable modern value
Reviewed by: Dan McDonald <danmcd@joyent.com>
Reviewed by: Jason King <jason.king@joyent.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Diffstat (limited to 'usr/src/uts/common/conf')
-rw-r--r-- | usr/src/uts/common/conf/param.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/usr/src/uts/common/conf/param.c b/usr/src/uts/common/conf/param.c index f5cb484c1a..1120748b98 100644 --- a/usr/src/uts/common/conf/param.c +++ b/usr/src/uts/common/conf/param.c @@ -22,7 +22,7 @@ /* * Copyright 2014 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 1983, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, Joyent, Inc. All rights reserved. + * Copyright 2017, Joyent, Inc. * Copyright 2012 Milan Jurik. All rights reserved. */ @@ -606,15 +606,26 @@ param_calc(int platform_max_nprocs) /* * We need to dynamically change any variables now so that - * the setting of maxusers and pidmax propagate to the other + * the setting of maxusers and maxpid propagate to the other * variables that are dependent on them. */ if (reserved_procs == 0) reserved_procs = 5; - if (pidmax < reserved_procs || pidmax > MAX_MAXPID) + if (pidmax < reserved_procs || pidmax > MAX_MAXPID) { maxpid = MAX_MAXPID; - else + } else { + /* + * If pidmax has not been explicity set in /etc/system, then + * increase it to the maximum on larger machines. We choose a + * 128GB memory size as the threshold to increase pidmax. + */ + if (pidmax == DEFAULT_MAXPID) { + if (physmem > (btop(128ULL * 0x40000000ULL))) { + pidmax = MAX_MAXPID; + } + } maxpid = pidmax; + } /* * This allows platform-dependent code to constrain the maximum |