]> git.hungrycats.org Git - linux/commit
[PATCH] fix & clean up zombie/dead task handling & preemption
authorIngo Molnar <mingo@elte.hu>
Mon, 18 Oct 2004 16:12:06 +0000 (09:12 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Mon, 18 Oct 2004 16:12:06 +0000 (09:12 -0700)
commitd3069b4dd0767b4e24debdb21b632b2f8dd72474
tree069671a054a203777b91dfe00e68392e4d774496
parent7a9a3e863d834b3c9abf46b7921654f16343b5bc
[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>
36 files changed:
arch/alpha/kernel/ptrace.c
arch/arm/kernel/ptrace.c
arch/arm26/kernel/ptrace.c
arch/cris/arch-v10/kernel/ptrace.c
arch/h8300/kernel/ptrace.c
arch/i386/kernel/ptrace.c
arch/ia64/kernel/perfmon.c
arch/ia64/kernel/ptrace.c
arch/m32r/kernel/ptrace.c
arch/m68k/kernel/ptrace.c
arch/m68knommu/kernel/ptrace.c
arch/mips/kernel/ptrace.c
arch/mips/kernel/ptrace32.c
arch/parisc/kernel/ptrace.c
arch/ppc/kernel/ptrace.c
arch/ppc64/kernel/ptrace.c
arch/ppc64/kernel/ptrace32.c
arch/s390/kernel/ptrace.c
arch/sh/kernel/ptrace.c
arch/sh64/kernel/ptrace.c
arch/sparc/kernel/ptrace.c
arch/sparc64/kernel/ptrace.c
arch/um/kernel/ptrace.c
arch/um/kernel/tt/process_kern.c
arch/v850/kernel/ptrace.c
arch/x86_64/kernel/ptrace.c
fs/exec.c
fs/proc/array.c
include/linux/sched.h
kernel/exit.c
kernel/fork.c
kernel/power/process.c
kernel/ptrace.c
kernel/sched.c
kernel/signal.c
kernel/timer.c