Re: Why wrapping PIDs is evil [was 32bit]

From: Stephen Frost (sfrost@ns.snowman.net)
Date: Mon Jan 17 2000 - 00:31:24 EST


On Sun, 16 Jan 2000, Horst von Brand wrote:

> > Someone want to sit and count sometime, how many processes are
> > started in a given (longish) time period? One thing that would be kind
> > of cute to hand le this would be a kernel log message saying every time
> > the PID count rolled over.
>
> One data point: My machine is now up for slightly more than a day (mostly
> idle, personal workstation). pids have rolled over at least once, and are
> now in the 400's. No compiling the kernel or anything like that which will
> boost the numbers. AFAIKS, when the system starts up in X (Gnome), it has
> run some 6000 processes already (that will take some 20s here)

        Well, at 6000 processes every 20 seconds (approx 300/second) and a
PID space of 4294967295 (32bit unsigned int), you will roll over/run out in
around 165 days. Of course, if you wanted to use a PID space of
18446744073709551616 (64bit unsigned int), you will roll over/run out in
around 1,949,808,057 years...
        Of course, who wants to type in a 20 digit number? :) I suppose if
you feel the need for security that badly you could patch the kernel to use
a 64bit PID space, and just panic when you run out, based on the assumption
that something _very_ bad is happening if you run out. :)

                Stephen

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



This archive was generated by hypermail 2b29 : Sun Jan 23 2000 - 21:00:14 EST