• John Wright's avatar
    sched: Fix a race between ttwu() and migrate_task() · c6fc81af
    John Wright authored
    Based on commit e2912009 upstream, but
    done differently as this issue is not present in .33 or .34 kernels due
    to rework in this area.
    
    If a task is in the TASK_WAITING state, then try_to_wake_up() is working
    on it, and it will place it on the correct cpu.
    
    This commit ensures that neither migrate_task() nor __migrate_task()
    calls set_task_cpu(p) while p is in the TASK_WAKING state.  Otherwise,
    there could be two concurrent calls to set_task_cpu(p), resulting in
    the task's cfs_rq being inconsistent with its cpu.
    Signed-off-by: default avatarJohn Wright <john.wright@hp.com>
    Cc: Ingo Molnar <mingo@elte.hu>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
    c6fc81af
sched.c 268 KB