|
33 | 33 | #include <linux/interrupt.h>
|
34 | 34 | #include <linux/kernel.h>
|
35 | 35 | #include <linux/kmod.h>
|
| 36 | +#include <linux/kthread.h> |
36 | 37 | #include <linux/list.h>
|
37 | 38 | #include <linux/mempolicy.h>
|
38 | 39 | #include <linux/mm.h>
|
@@ -1127,10 +1128,18 @@ static void update_tasks_cpumask(struct cpuset *cs)
|
1127 | 1128 | {
|
1128 | 1129 | struct css_task_iter it;
|
1129 | 1130 | struct task_struct *task;
|
| 1131 | + bool top_cs = cs == &top_cpuset; |
1130 | 1132 |
|
1131 | 1133 | css_task_iter_start(&cs->css, 0, &it);
|
1132 |
| - while ((task = css_task_iter_next(&it))) |
| 1134 | + while ((task = css_task_iter_next(&it))) { |
| 1135 | + /* |
| 1136 | + * Percpu kthreads in top_cpuset are ignored |
| 1137 | + */ |
| 1138 | + if (top_cs && (task->flags & PF_KTHREAD) && |
| 1139 | + kthread_is_per_cpu(task)) |
| 1140 | + continue; |
1133 | 1141 | set_cpus_allowed_ptr(task, cs->effective_cpus);
|
| 1142 | + } |
1134 | 1143 | css_task_iter_end(&it);
|
1135 | 1144 | }
|
1136 | 1145 |
|
@@ -2092,12 +2101,7 @@ static int update_prstate(struct cpuset *cs, int new_prs)
|
2092 | 2101 | update_flag(CS_CPU_EXCLUSIVE, cs, 0);
|
2093 | 2102 | }
|
2094 | 2103 |
|
2095 |
| - /* |
2096 |
| - * Update cpumask of parent's tasks except when it is the top |
2097 |
| - * cpuset as some system daemons cannot be mapped to other CPUs. |
2098 |
| - */ |
2099 |
| - if (parent != &top_cpuset) |
2100 |
| - update_tasks_cpumask(parent); |
| 2104 | + update_tasks_cpumask(parent); |
2101 | 2105 |
|
2102 | 2106 | if (parent->child_ecpus_count)
|
2103 | 2107 | update_sibling_cpumasks(parent, cs, &tmpmask);
|
|
0 commit comments