Re: [patch] lockless, scalable get_pid(), for_each_process()

Rik van Riel (riel@conectiva.com.br)
Wed, 18 Sep 2002 13:32:29 -0300 (BRT)


On Wed, 18 Sep 2002, Linus Torvalds wrote:

> I would suggest something like this:
> - make pid_max start out at 32k or whatever, to make "ps" look nice if
> nothing else.
> - every time we have _any_ trouble at all with looking up a new pid, we
> double pid_max.

> + if (nr_threads > pid_max >> 4)
> + pid_max <<= 1;

... but watch out for over/underflow. ;)

It would also be nice if we had some known limit on pid_max (say 8
million, fits in 7 digits).

regards,

Rik

-- 
Spamtrap of the month: september@surriel.com

http://www.surriel.com/ http://distro.conectiva.com/

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/