• Oleg Nesterov's avatar
    [PATCH] select_bad_process(): kill a bogus PF_DEAD/TASK_DEAD check · 28324d1d
    Oleg Nesterov authored
    The only one usage of TASK_DEAD outside of last schedule path,
    
    select_bad_process:
    
    	for_each_task(p) {
    
    		if (!p->mm)
    			continue;
    		...
    			if (p->state == TASK_DEAD)
    				continue;
    		...
    
    TASK_DEAD state is set at the end of do_exit(), this means that p->mm
    was already set == NULL by exit_mm(), so this task was already rejected
    by 'if (!p->mm)' above.
    
    Note also that the caller holds tasklist_lock, this means that p can't
    pass exit_notify() and then set TASK_DEAD when p->mm != NULL.
    
    Also, remove open-coded is_init().
    Signed-off-by: default avatarOleg Nesterov <oleg@tv-sign.ru>
    Cc: Ingo Molnar <mingo@elte.hu>
    Cc: Nick Piggin <nickpiggin@yahoo.com.au>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    28324d1d
oom_kill.c 11.3 KB