]> git.hungrycats.org Git - linux/commitdiff
Make pid allocation use 30 of the 32 bits, instead of 15.
authorLinus Torvalds <torvalds@home.transmeta.com>
Thu, 8 Aug 2002 10:57:42 +0000 (03:57 -0700)
committerLinus Torvalds <torvalds@home.transmeta.com>
Thu, 8 Aug 2002 10:57:42 +0000 (03:57 -0700)
include/linux/threads.h
kernel/fork.c

index 880b990f8251449a6876dba1d04d01e7a378408f..6804ee73640fff7adedae54efa58b90a1ace2f7a 100644 (file)
@@ -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
index d40d246ec1dfd9e29c052e4b22dbaa873229b8dc..017740dc62c4c485679e5830b5cf39953416c9fe 100644 (file)
@@ -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 @@ inside:
                           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;
                                }