Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
add8bcb8
Commit
add8bcb8
authored
Aug 08, 2002
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make pid allocation use 30 of the 32 bits, instead of 15.
parent
b14ebcfc
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
include/linux/threads.h
include/linux/threads.h
+2
-1
kernel/fork.c
kernel/fork.c
+2
-2
No files found.
include/linux/threads.h
View file @
add8bcb8
...
...
@@ -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
kernel/fork.c
View file @
add8bcb8
...
...
@@ -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
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment