Subject: PID_MAX and NO_PID
To: None <tech-kern@netbsd.org>
From: David Laight <david@l8s.co.uk>
List: tech-kern
Date: 12/17/2002 14:45:39
Currently netbsd has PID_MAX = 30000 and NO_PID = 30001.
These limits are getting to be obtainable - see the recent
thread about running out of GDT slots if maxprox > 8192.

AFAICT NO_PID is only used to mean 'no process group' so calling
it NO_PGID and using the value -1 would be more reasonable.
Indeed it is only usually used if ttyp->t_pgrp is null.

Actually replacing ttyp->t_pgrp with ttyp->pgid (ie changing
the pointer for a number) simplifies a lot of code.  Most users
either want the pgid of are going to call psignal().

PID_MAX also seems a bit anachronistic.  As numproc approaches
PID_MAX pid numbers will start to be reused too quickly.  With
32bit pids (on most, if not all?, ports) allowing large systems
to use pids >30000 (without recompiling the kernel) would
seem appropriate.

Using a 'soft' PID_MAX which gets doubled when numproc*2 > PID_MAX
would stop large pids being allocated on small systems.
(the only other use of PID_MAX is atopid())

Diffs could be forthcoming...

	David

-- 
David Laight: david@l8s.co.uk