Skip to contentSkip to conversation

PF_DEAD cleanup

PATCH New Coywolf Qi Hunt 1 participant 1 message Oct 8, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PF_DEAD cleanup

Hello,

The PF_DEAD setting doesn't belong to exit_notify(), move it to a proper place.

Coywolf

---

 exit.c |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
kernel/exit.c renamed from kernel/exit.c~orig +4 -5
@@ -783,10 +783,6 @@ static void exit_notify(struct task_stru
 	/* 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)
@@ -869,7 +865,10 @@ fastcall NORET_TYPE void do_exit(long co
 	tsk->mempolicy = NULL;
 #endif
 
-	BUG_ON(!(current->flags & PF_DEAD));
+	/* PF_DEAD causes final put_task_struct after we schedule. */
+	preempt_disable();
+	current->flags |= PF_DEAD;
+
 	schedule();
 	BUG();
 	/* Avoid "noreturn function does return".  */