diff --git a/include/linux/sched.h b/include/linux/sched.h index 95f248ba36c9bae2face0ffd725cc7917e58e67c..7e0ff5dba986cf19daeadadaf0cc7fa985d7aaf6 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -911,7 +911,7 @@ extern void __put_task_struct(struct task_struct *t); static inline void put_task_struct(struct task_struct *t) { if (atomic_dec_and_test(&t->usage)) - call_rcu(&t->rcu, __put_task_struct_cb); + __put_task_struct(t); } /* diff --git a/kernel/exit.c b/kernel/exit.c index bc0ec674d3f4c4fde1332dacc7e436d63a81c5e5..6c2eeb8f6390c1ae1daeb3b12ecd3aa974b3c599 100644 --- a/kernel/exit.c +++ b/kernel/exit.c @@ -127,6 +127,11 @@ static void __exit_signal(struct task_struct *tsk) } } +static void delayed_put_task_struct(struct rcu_head *rhp) +{ + put_task_struct(container_of(rhp, struct task_struct, rcu)); +} + void release_task(struct task_struct * p) { int zap_leader; @@ -168,7 +173,7 @@ void release_task(struct task_struct * p) spin_unlock(&p->proc_lock); proc_pid_flush(proc_dentry); release_thread(p); - put_task_struct(p); + call_rcu(&p->rcu, delayed_put_task_struct); p = leader; if (unlikely(zap_leader))