Commit 70ee794
sched: fix warning in sched_setaffinity
Commit 8f9ea86 added some logic to sched_setaffinity that included
a WARN when a per-task affinity assignment races with a cpuset update.
Specifically, we can have a race where a cpuset update results in the
task affinity no longer being a subset of the cpuset. That's fine; we
have a fallback to instead use the cpuset mask. However, we have a WARN
set up that will trigger if the cpuset mask has no overlap at all with
the requested task affinity. This shouldn't be a warning condition; its
trivial to create this condition.
Reproduced the warning by the following setup:
- $PID inside a cpuset cgroup
- another thread repeatedly switching the cpuset cpus from 1-2 to just 1
- another thread repeatedly setting the $PID affinity (via taskset) to 2
Fixes: 8f9ea86 ("sched: Always preserve the user requested cpumask")
Signed-off-by: Josh Don <[email protected]>
Acked-and-tested-by: Vincent Guittot <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Acked-by: Waiman Long <[email protected]>
Tested-by: Madadi Vineeth Reddy <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]1 parent 22368fe commit 70ee794
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1200 | 1200 | | |
1201 | 1201 | | |
1202 | 1202 | | |
1203 | | - | |
| 1203 | + | |
1204 | 1204 | | |
1205 | 1205 | | |
1206 | 1206 | | |
| |||
0 commit comments