Subject: Re: new pid allocation code
To: David Laight <david@l8s.co.uk>
From: Bill Studenmund <wrstuden@netbsd.org>
List: tech-kern
Date: 03/11/2003 16:47:53
On Wed, 12 Mar 2003, David Laight wrote:

> > What is the layout of how you use bits in a PID?
>
> It dynamically changes.  The bottom bits index the table and high bits
> are the sequence count (zapped to zero when they get to PID_MAX).
> When the table size has to be increased, the boundary point is moved.
> So if PID_MAX is 32767 you might start with 32 slots each with 1024
> pid values, as soon as you have (about) 30 active processes the table
> grows to 64 slots each of which has 512 pid values.

Hmmm.... I was thinking that'd cause a problem because when you grow the
table, sequence # bits now are slot ID bits. But if you're careful when
you split, it should be ok (i.e. some existing processes might end up in
the new part of the table).

Take care,

Bill