Skip to content

Commit

Permalink
[PATCH] PF_DEAD cleanup
Browse files Browse the repository at this point in the history
The PF_DEAD setting doesn't belong to exit_notify(), move it to a proper
place.

Signed-off-by: Coywolf Qi Hunt <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Coywolf Qi Hunt authored and Linus Torvalds committed Oct 31, 2005
1 parent 40dc565 commit 7407251
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions kernel/exit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 (state == EXIT_DEAD)
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)
Expand Down Expand Up @@ -873,7 +869,11 @@ fastcall NORET_TYPE void do_exit(long code)
tsk->mempolicy = NULL;
#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();
BUG();
/* Avoid "noreturn function does return". */
Expand Down

0 comments on commit 7407251

Please sign in to comment.