Commit 9e81889
sched: Fix affine_move_task() self-concurrency
Consider:
sched_setaffinity(p, X); sched_setaffinity(p, Y);
Then the first will install p->migration_pending = &my_pending; and
issue stop_one_cpu_nowait(pending); and the second one will read
p->migration_pending and _also_ issue: stop_one_cpu_nowait(pending),
the _SAME_ @pending.
This causes stopper list corruption.
Add set_affinity_pending::stop_pending, to indicate if a stopper is in
progress.
Fixes: 6d337ea ("sched: Fix migrate_disable() vs set_cpus_allowed_ptr()")
Cc: stable@kernel.org
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Reviewed-by: Valentin Schneider <valentin.schneider@arm.com>
Link: https://lkml.kernel.org/r/20210224131355.649146419@infradead.org1 parent 3f1bc11 commit 9e81889
1 file changed
+12
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1864 | 1864 | | |
1865 | 1865 | | |
1866 | 1866 | | |
| 1867 | + | |
1867 | 1868 | | |
1868 | 1869 | | |
1869 | 1870 | | |
| |||
1982 | 1983 | | |
1983 | 1984 | | |
1984 | 1985 | | |
| 1986 | + | |
1985 | 1987 | | |
1986 | 1988 | | |
1987 | 1989 | | |
1988 | 1990 | | |
1989 | 1991 | | |
1990 | 1992 | | |
| 1993 | + | |
| 1994 | + | |
1991 | 1995 | | |
1992 | 1996 | | |
1993 | 1997 | | |
| |||
2183 | 2187 | | |
2184 | 2188 | | |
2185 | 2189 | | |
2186 | | - | |
| 2190 | + | |
2187 | 2191 | | |
2188 | 2192 | | |
2189 | 2193 | | |
| |||
2256 | 2260 | | |
2257 | 2261 | | |
2258 | 2262 | | |
| 2263 | + | |
| 2264 | + | |
| 2265 | + | |
2259 | 2266 | | |
2260 | 2267 | | |
2261 | 2268 | | |
2262 | 2269 | | |
2263 | 2270 | | |
2264 | 2271 | | |
2265 | | - | |
2266 | | - | |
| 2272 | + | |
| 2273 | + | |
| 2274 | + | |
| 2275 | + | |
2267 | 2276 | | |
2268 | 2277 | | |
2269 | 2278 | | |
| |||
0 commit comments