Commit 7407251a authored by Coywolf Qi Hunt's avatar Coywolf Qi Hunt Committed by Linus Torvalds
Browse files

[PATCH] PF_DEAD cleanup



The PF_DEAD setting doesn't belong to exit_notify(), move it to a proper
place.
Signed-off-by: default avatarCoywolf Qi Hunt <qiyong@fc-cn.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 40dc5651
...@@ -783,10 +783,6 @@ static void exit_notify(struct task_struct *tsk) ...@@ -783,10 +783,6 @@ static void exit_notify(struct task_struct *tsk)
/* If the process is dead, release it - nobody will wait for it */ /* If the process is dead, release it - nobody will wait for it */
if (state == EXIT_DEAD) if (state == EXIT_DEAD)
release_task(tsk); release_task(tsk);
/* PF_DEAD causes final put_task_struct after we schedule. */
preempt_disable();
tsk->flags |= PF_DEAD;
} }
fastcall NORET_TYPE void do_exit(long code) fastcall NORET_TYPE void do_exit(long code)
...@@ -873,7 +869,11 @@ fastcall NORET_TYPE void do_exit(long code) ...@@ -873,7 +869,11 @@ fastcall NORET_TYPE void do_exit(long code)
tsk->mempolicy = NULL; tsk->mempolicy = NULL;
#endif #endif
BUG_ON(!(current->flags & PF_DEAD)); /* PF_DEAD causes final put_task_struct after we schedule. */
preempt_disable();
BUG_ON(tsk->flags & PF_DEAD);
tsk->flags |= PF_DEAD;
schedule(); schedule();
BUG(); BUG();
/* Avoid "noreturn function does return". */ /* Avoid "noreturn function does return". */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment