summaryrefslogtreecommitdiff
path: root/include/linux/pid.h
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2017-09-26 21:06:43 +0300
committerEric W. Biederman <ebiederm@xmission.com>2018-07-21 18:43:12 +0300
commit2c4704756cab7cfa031ada4dab361562f0e357c0 (patch)
tree8757eb8762d60e34eeab747493759abf3f902c09 /include/linux/pid.h
parent71dbc8a96953aa91c50181a526acb7f80af74f67 (diff)
downloadlinux-2c4704756cab7cfa031ada4dab361562f0e357c0.tar.xz
pids: Move the pgrp and session pid pointers from task_struct to signal_struct
To access these fields the code always has to go to group leader so going to signal struct is no loss and is actually a fundamental simplification. This saves a little bit of memory by only allocating the pid pointer array once instead of once for every thread, and even better this removes a few potential races caused by the fact that group_leader can be changed by de_thread, while signal_struct can not. Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Diffstat (limited to 'include/linux/pid.h')
-rw-r--r--include/linux/pid.h8
1 files changed, 1 insertions, 7 deletions
diff --git a/include/linux/pid.h b/include/linux/pid.h
index 7633d55d9a24..3d4c504dcc8c 100644
--- a/include/linux/pid.h
+++ b/include/linux/pid.h
@@ -67,12 +67,6 @@ struct pid
extern struct pid init_struct_pid;
-struct pid_link
-{
- struct hlist_node node;
- struct pid *pid;
-};
-
static inline struct pid *get_pid(struct pid *pid)
{
if (pid)
@@ -177,7 +171,7 @@ pid_t pid_vnr(struct pid *pid);
do { \
if ((pid) != NULL) \
hlist_for_each_entry_rcu((task), \
- &(pid)->tasks[type], pids[type].node) {
+ &(pid)->tasks[type], pid_links[type]) {
/*
* Both old and new leaders may be attached to