diff options
-rw-r--r-- | include/linux/sched.h | 2 | ||||
-rw-r--r-- | kernel/exit.c | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index 95f248ba36c9..7e0ff5dba986 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -911,7 +911,7 @@ extern void __put_task_struct(struct task_struct *t); | |||
911 | static inline void put_task_struct(struct task_struct *t) | 911 | static inline void put_task_struct(struct task_struct *t) |
912 | { | 912 | { |
913 | if (atomic_dec_and_test(&t->usage)) | 913 | if (atomic_dec_and_test(&t->usage)) |
914 | call_rcu(&t->rcu, __put_task_struct_cb); | 914 | __put_task_struct(t); |
915 | } | 915 | } |
916 | 916 | ||
917 | /* | 917 | /* |
diff --git a/kernel/exit.c b/kernel/exit.c index bc0ec674d3f4..6c2eeb8f6390 100644 --- a/kernel/exit.c +++ b/kernel/exit.c | |||
@@ -127,6 +127,11 @@ static void __exit_signal(struct task_struct *tsk) | |||
127 | } | 127 | } |
128 | } | 128 | } |
129 | 129 | ||
130 | static void delayed_put_task_struct(struct rcu_head *rhp) | ||
131 | { | ||
132 | put_task_struct(container_of(rhp, struct task_struct, rcu)); | ||
133 | } | ||
134 | |||
130 | void release_task(struct task_struct * p) | 135 | void release_task(struct task_struct * p) |
131 | { | 136 | { |
132 | int zap_leader; | 137 | int zap_leader; |
@@ -168,7 +173,7 @@ repeat: | |||
168 | spin_unlock(&p->proc_lock); | 173 | spin_unlock(&p->proc_lock); |
169 | proc_pid_flush(proc_dentry); | 174 | proc_pid_flush(proc_dentry); |
170 | release_thread(p); | 175 | release_thread(p); |
171 | put_task_struct(p); | 176 | call_rcu(&p->rcu, delayed_put_task_struct); |
172 | 177 | ||
173 | p = leader; | 178 | p = leader; |
174 | if (unlikely(zap_leader)) | 179 | if (unlikely(zap_leader)) |