]> www.infradead.org Git - users/jedix/linux-maple.git/commit
sched: Fix race in task_group()
authorPeter Zijlstra <peterz@infradead.org>
Fri, 22 Jun 2012 11:36:05 +0000 (13:36 +0200)
committerGuangyu Sun <guangyu.sun@oracle.com>
Mon, 8 Oct 2012 17:00:58 +0000 (10:00 -0700)
commitfe5bfdd5e25793b155a6ec27d07c5b9b23c0635c
tree561c98ea8a4e8df1c144f9ee860b610d8b3b3ee0
parentf4debd60eb528220fde726761d8fc51012364639
sched: Fix race in task_group()

commit 8323f26ce3425460769605a6aece7a174edaa7d1 upstream.

Stefan reported a crash on a kernel before a3e5d1091c1 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Guangyu Sun <guangyu.sun@oracle.com>
include/linux/init_task.h
include/linux/sched.h
kernel/sched.c