]> git.karo-electronics.de Git - karo-tx-linux.git/commit
sched: Fix a race between ttwu() and migrate_task()
authorJohn Wright <john.wright@hp.com>
Tue, 13 Apr 2010 22:55:37 +0000 (16:55 -0600)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 26 Apr 2010 14:41:33 +0000 (07:41 -0700)
commitc6fc81afa2d7ef2f775e48672693d8a0a8a7325d
treed036b80068d3f9df0d4122b3f7ad901f24dae1c8
parent328851d3f993704cb61a74cdf8af88d987302812
sched: Fix a race between ttwu() and migrate_task()

Based on commit e2912009fb7b715728311b0d8fe327a1432b3f79 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: John Wright <john.wright@hp.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
kernel/sched.c