Subject: Re: new pid allocation - any advantages?
To: David Laight <david@l8s.co.uk>
From: Luke Mewburn <lukem@netbsd.org>
List: tech-kern
Date: 03/27/2003 22:13:42
On Fri, Mar 21, 2003 at 12:18:35PM +0000, David Laight wrote:
  | Jaromir Dolecek wrote:
  | > I'd still be interested to know if you tested the code
  | > for PID > 16k and PID > 30k cases, though.
  | 
  | The cases where tested by seeing the effects of running a kernel
  | that was compiled with a very low PID_MAX.
  | (I probably ran one with PID_MAX set to 16, and an initial table size of 2).

I think Jaromir's point is do you prevent PIDs greater than PID_MAX
from being assigined?

I.e, if PID_MAX is 30000, can a PID > 30000 ever be allocated?
If so, then this is not the correct behaviour IMHO.

I can think of specific cases where a user does not want a new PID to
exceed PID_MAX under any circumstance.  E.g, for compatiblity with
certain systems with 16 bit PIDs (PID_MAX =~ 32767), or where PIDs
aren't to exceed 5 digits when printed (PID_MAX == 99999).

Also, procfs checks that the requested pid doesn't exceed PID_MAX,
so if your code doesn't enforce this limitation, you won't be able to
access those via procfs. ("oops!")

Luke.