Re: [RFC] ps command race fix

From: KAMEZAWA Hiroyuki
Date: Mon Jul 24 2006 - 23:12:19 EST


On Tue, 25 Jul 2006 11:50:04 +0900
KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx> wrote:

> BTW, how large pids and how many proccess in a (heavy and big) system ?
>
I found
/*
* A maximum of 4 million PIDs should be enough for a while.
* [NOTE: PID/TIDs are limited to 2^29 ~= 500+ million, see futex.h.]
*/
#define PID_MAX_LIMIT (CONFIG_BASE_SMALL ? PAGE_SIZE * 8 : \
(sizeof(long) > 4 ? 4 * 1024 * 1024 : PID_MAX_DEFAULT))

...we have to manage 4 millions tids.

I'll try to make use of pidmap array which is already maintained in pid.c
and to avoid using extra memory.

Thanks,
-Kame

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