• Ingo Molnar's avatar
    [PATCH] fix & clean up zombie/dead task handling & preemption · d3069b4d
    Ingo Molnar authored
    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: default avatarIngo Molnar <mingo@elte.hu>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    d3069b4d
sched.c 113 KB