JKH project..

Xin LI delphij at frontfree.net
Mon Apr 12 17:52:39 PDT 2004

On Mon, Apr 12, 2004 at 04:50:18PM -0700, Julian Elischer wrote:
> On Tue, 13 Apr 2004, Tim Robbins wrote:
> > On Sun, Apr 11, 2004 at 03:51:45PM -0700, Julian Elischer wrote:
> > 
> > > the fork syscall has to check the new PID against all exixting pids..
> > > 
> > > here's the current code.. when teh PID-space starts becoming
> > > "fragmented.."  this starts to take "real time".
> > [...]
> > > with several thousand processes, forking a lot, this starts to take 
> > > a 'noticable' amount of time.
> > 
> > I've been using a hashtable-based PID allocator for the last few months.
> > I didn't have enough time to run any serious benchmarks, so I never
> > committed it. If the amount of time is noticeable in your environment,
> > would you mind trying the patch below?
> > 
> Well what you've done seems to fit my definition of "improved"..
> anyone got comments?

If memory serves me right, there's a benchmark done by David Schultz
earlier this year, which is done to compare the NetBSD's PID Allocator
ported by Jun Su[1,2] with Tim's hash based allocator[3] in p4.

The benchmark report is available here:


[1] Jun Su's original patch
[2] Jun Su's patch I maintained locally to adopt latest -CURRENT changes
[3] Tim's patch in p4

There were a discussion in current@ in February, for reference:

My first post in January as a "Call for testers":

Jun Su's post about update of his patch:

David Schultz's post of his benchmark:

John's opinion:

There're many other discussions during this, which is valuable to

I personally prefered junsu's version as the side effect of the patch
makes pids smaller, however, I'd concur the concerns about simplicity
of code will be a good reason of the final decision.

Xin LI <delphij frontfree net>	http://www.delphij.net/
See complete headers for GPG key and other information.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-current/attachments/20040413/5637d4a5/attachment.bin

More information about the freebsd-current mailing list