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 /fs/proc/array.c | |
| 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 'fs/proc/array.c')
| -rw-r--r-- | fs/proc/array.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/proc/array.c b/fs/proc/array.c index d05dab0697d3..5c289c73a00e 100644 --- a/fs/proc/array.c +++ b/fs/proc/array.c @@ -137,13 +137,13 @@ static const char *task_state_array[] = { static inline const char * get_task_state(struct task_struct *tsk) { - unsigned int state = tsk->state & (TASK_RUNNING | - TASK_INTERRUPTIBLE | - TASK_UNINTERRUPTIBLE | - TASK_ZOMBIE | - TASK_DEAD | - TASK_STOPPED | - TASK_TRACED); + unsigned int state = (tsk->state & (TASK_RUNNING | + TASK_INTERRUPTIBLE | + TASK_UNINTERRUPTIBLE | + TASK_STOPPED | + TASK_TRACED)) | + (tsk->exit_state & (EXIT_ZOMBIE | + EXIT_DEAD)); const char **p = &task_state_array[0]; while (state) { |
