Subject: Re: new pid allocation code
To: Jason R Thorpe <email@example.com>
From: David Laight <firstname.lastname@example.org>
Date: 03/12/2003 00:28:34
> Pretty cool. Have you done any benchmarks to see if the improved lookup
> algorithm has a noticeable impact?
No - I suspect it makes little difference most of the time, howver if
the number of processe is large compared to MAXUSERS (or something has
caused the hashing to go awry) then pid lookup will be improved.
Also if the number of active processes approaches PID_MAX the current
code will do a lot of searching.
> A couple of comments:
> * Please see /usr/share/misc/style regarding formatting of
> comments :-)
Yes - I wrote the code quite a while ago...
> * Don't use MALLOC()/FREE() for variable-sized allocations; use
> malloc()/free() instead.
I know - I presume I left one lurking....
> * I think proc0_insert() is a better name than set_proc_0().
> All in all, looks good. But can you explain how the deadproc linkage
> works in the new scheme? (Since you didn't post all of those changes...)
IIRC I just ran a LIFO list since there wasn't a spare pair of pointers
for a FIFO one.
David Laight: email@example.com