diff options
| author | Ingo Molnar <mingo@elte.hu> | 2004-10-18 09:12:06 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-10-18 09:12:06 -0700 |
| commit | d3069b4dd0767b4e24debdb21b632b2f8dd72474 (patch) | |
| tree | 069671a054a203777b91dfe00e68392e4d774496 /include/linux | |
| parent | 7a9a3e863d834b3c9abf46b7921654f16343b5bc (diff) | |
[PATCH] fix & clean up zombie/dead task handling & preemption
This patch fixes all the preempt-after-task->state-is-TASK_DEAD problems we
had. Right now, the moment procfs does a down() that sleeps in
proc_pid_flush() [it could] our TASK_DEAD state is zapped and we might be
back to TASK_RUNNING to and we trigger this assert:
schedule();
BUG();
/* Avoid "noreturn function does return". */
for (;;) ;
I have split out TASK_ZOMBIE and TASK_DEAD into a separate p->exit_state
field, to allow the detaching of exit-signal/parent/wait-handling from
descheduling a dead task. Dead-task freeing is done via PF_DEAD.
Tested the patch on x86 SMP and UP, but all architectures should work
fine.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/sched.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index 69648ed7fd2b..dc3f297a726d 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -108,8 +108,8 @@ extern unsigned long nr_iowait(void); #define TASK_UNINTERRUPTIBLE 2 #define TASK_STOPPED 4 #define TASK_TRACED 8 -#define TASK_ZOMBIE 16 -#define TASK_DEAD 32 +#define EXIT_ZOMBIE 16 +#define EXIT_DEAD 32 #define __set_task_state(tsk, state_value) \ do { (tsk)->state = (state_value); } while (0) @@ -564,6 +564,7 @@ struct task_struct { /* task state */ struct linux_binfmt *binfmt; + long exit_state; int exit_code, exit_signal; int pdeath_signal; /* The signal sent when the parent dies */ /* ??? */ |
