From: Peter Zijlstra Date: Fri, 22 Jun 2012 11:36:05 +0000 (+0200) Subject: sched: Fix race in task_group() X-Git-Tag: v3.2.27~70 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b75bfc42974aaf089ae7eae5d3c6bf362f57ee93;p=pandora-kernel.git 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 Signed-off-by: Peter Zijlstra Link: http://lkml.kernel.org/r/1340364965.18025.71.camel@twins Signed-off-by: Ingo Molnar (backported to previous file names and layout) Signed-off-by: Stefan Bader Signed-off-by: Ben Hutchings --- Reading git-diff-tree failed