Repository navigation
Commit b75bfc4
sched: Fix race in task_group()
commit 8323f26 upstream
Stefan reported a crash on a kernel before a3e5d10 ("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>
(backported to previous file names and layout)
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>1 parent 46159f6 commit b75bfc4
3 files changed
Lines changed: 33 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
127 | 136 | | |
128 | | - | |
| 137 | + | |
129 | 138 | | |
130 | 139 | | |
131 | 140 | | |
| |||
162 | 171 | | |
163 | 172 | | |
164 | 173 | | |
| 174 | + | |
165 | 175 | | |
166 | 176 | | |
167 | 177 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1236 | 1236 | | |
1237 | 1237 | | |
1238 | 1238 | | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
1239 | 1242 | | |
1240 | 1243 | | |
1241 | 1244 | | |
| |||
2646 | 2649 | | |
2647 | 2650 | | |
2648 | 2651 | | |
2649 | | - | |
| 2652 | + | |
2650 | 2653 | | |
2651 | 2654 | | |
2652 | 2655 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
746 | 746 | | |
747 | 747 | | |
748 | 748 | | |
749 | | - | |
750 | | - | |
751 | | - | |
752 | | - | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
753 | 758 | | |
754 | 759 | | |
755 | 760 | | |
756 | | - | |
757 | | - | |
758 | | - | |
759 | | - | |
760 | | - | |
761 | | - | |
762 | | - | |
763 | | - | |
764 | | - | |
| 761 | + | |
765 | 762 | | |
766 | 763 | | |
767 | 764 | | |
| |||
2372 | 2369 | | |
2373 | 2370 | | |
2374 | 2371 | | |
2375 | | - | |
| 2372 | + | |
2376 | 2373 | | |
2377 | 2374 | | |
2378 | 2375 | | |
| |||
8952 | 8949 | | |
8953 | 8950 | | |
8954 | 8951 | | |
| 8952 | + | |
8955 | 8953 | | |
8956 | 8954 | | |
8957 | 8955 | | |
| |||
8966 | 8964 | | |
8967 | 8965 | | |
8968 | 8966 | | |
| 8967 | + | |
| 8968 | + | |
| 8969 | + | |
| 8970 | + | |
| 8971 | + | |
| 8972 | + | |
8969 | 8973 | | |
8970 | 8974 | | |
8971 | 8975 | | |
| |||
0 commit comments