Commit df3cb4e
sched/fair: Fix wrong cpu selecting from isolated domain
We've met problems that occasionally tasks with full cpumask
(e.g. by putting it into a cpuset or setting to full affinity)
were migrated to our isolated cpus in production environment.
After some analysis, we found that it is due to the current
select_idle_smt() not considering the sched_domain mask.
Steps to reproduce on my 31-CPU hyperthreads machine:
1. with boot parameter: "isolcpus=domain,2-31"
(thread lists: 0,16 and 1,17)
2. cgcreate -g cpu:test; cgexec -g cpu:test "test_threads"
3. some threads will be migrated to the isolated cpu16~17.
Fix it by checking the valid domain mask in select_idle_smt().
Fixes: 10e2f1a ("sched/core: Rewrite and improve select_idle_siblings())
Reported-by: Wetp Zhang <wetp.zy@linux.alibaba.com>
Signed-off-by: Xunlei Pang <xlpang@linux.alibaba.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Jiang Biao <benbjiang@tencent.com>
Reviewed-by: Vincent Guittot <vincent.guittot@linaro.org>
Link: https://lkml.kernel.org/r/1600930127-76857-1-git-send-email-xlpang@linux.alibaba.com1 parent 51bd512 commit df3cb4e
1 file changed
Lines changed: 5 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6080 | 6080 | | |
6081 | 6081 | | |
6082 | 6082 | | |
6083 | | - | |
| 6083 | + | |
6084 | 6084 | | |
6085 | 6085 | | |
6086 | 6086 | | |
6087 | 6087 | | |
6088 | 6088 | | |
6089 | 6089 | | |
6090 | 6090 | | |
6091 | | - | |
| 6091 | + | |
| 6092 | + | |
6092 | 6093 | | |
6093 | 6094 | | |
6094 | 6095 | | |
| |||
6104 | 6105 | | |
6105 | 6106 | | |
6106 | 6107 | | |
6107 | | - | |
| 6108 | + | |
6108 | 6109 | | |
6109 | 6110 | | |
6110 | 6111 | | |
| |||
6279 | 6280 | | |
6280 | 6281 | | |
6281 | 6282 | | |
6282 | | - | |
| 6283 | + | |
6283 | 6284 | | |
6284 | 6285 | | |
6285 | 6286 | | |
| |||
0 commit comments