]> git.baikalelectronics.ru Git - kernel.git/commit
sched: Fix race in task_group()
authorPeter Zijlstra <peterz@infradead.org>
Fri, 22 Jun 2012 11:36:05 +0000 (13:36 +0200)
committerIngo Molnar <mingo@kernel.org>
Tue, 24 Jul 2012 11:58:20 +0000 (13:58 +0200)
commit0dd5952b10bd4f5810f802a0a89a38e9ca8af9c1
tree44daa0dafa49cedc9301efd1417c6c2ac338c1c7
parent3f7bafec568e7d546ce5336a7763e40b90229f5a
sched: Fix race in task_group()

Stefan reported a crash on a kernel before 7f41ee49b9b ("sched:
Don't call task_group() too many times in set_task_rq()"), he
found the reason to be that the multiple task_group()
invocations in set_task_rq() returned different values.

Looking at all that I found a lack of serialization and plain
wrong comments.

The below tries to fix it using an extra pointer which is
updated under the appropriate scheduler locks. Its not pretty,
but I can't really see another way given how all the cgroup
stuff works.

Reported-and-tested-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1340364965.18025.71.camel@twins
Signed-off-by: Ingo Molnar <mingo@kernel.org>
include/linux/init_task.h
include/linux/sched.h
kernel/sched/core.c
kernel/sched/sched.h