kernel - Improve pid-reuse algorithm, fix bug
authorMatthew Dillon <dillon@apollo.backplane.com>
Mon, 21 Apr 2014 22:00:00 +0000 (15:00 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Mon, 21 Apr 2014 22:00:00 +0000 (15:00 -0700)
commit3a877e444fff816b8a340d35fe32692d81753695
tree540326382cba043a0a1c3386a04caa51ffa3f3cf
parent5eb65d9205846fbeb2ea6f7afdf20696ca007b21
kernel - Improve pid-reuse algorithm, fix bug

* Fix a bug where under extreme loads it was possible for a PID to be
  allocated twice.

* Implement a minimum pid-reuse delay of 10 seconds.  No pid, session id,
  or pgid will be reused for at least 10 seconds after being reaped.

  This shouldn't really be necessary but it should help scripts, particularly
  bulk builds, which rely on testing out-of-band PIDs with pwait.

* Increase PID_MAX from 99999 to 999999

Reported-by: marino
sys/kern/kern_proc.c
sys/sys/proc.h