Commit add8bcb8 authored by Linus Torvalds's avatar Linus Torvalds

Make pid allocation use 30 of the 32 bits, instead of 15.

parent b14ebcfc
......@@ -19,6 +19,7 @@
/*
* This controls the maximum pid allocated to a process
*/
#define PID_MAX 0x8000
#define PID_MASK 0x3fffffff
#define PID_MAX (PID_MASK+1)
#endif
......@@ -142,7 +142,7 @@ static int get_pid(unsigned long flags)
return 0;
spin_lock(&lastpid_lock);
if((++last_pid) & 0xffff8000) {
if((++last_pid) & ~PID_MASK) {
last_pid = 300; /* Skip daemons etc. */
goto inside;
}
......@@ -157,7 +157,7 @@ static int get_pid(unsigned long flags)
p->tgid == last_pid ||
p->session == last_pid) {
if(++last_pid >= next_safe) {
if(last_pid & 0xffff8000)
if(last_pid & ~PID_MASK)
last_pid = 300;
next_safe = PID_MAX;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment