Skip to content

Commit e0e80a0

Browse files
Li Zhonghtejun
authored andcommitted
cpuset: use rebuild_sched_domains() in cpuset_hotplug_workfn()
In cpuset_hotplug_workfn(), partition_sched_domains() is called without hotplug lock held, which is actually needed (stated in the function header of partition_sched_domains()). This patch tries to use rebuild_sched_domains() to solve the above issue, and makes the code looks a little simpler. Signed-off-by: Li Zhong <zhong@linux.vnet.ibm.com> Signed-off-by: Li Zefan <lizefan@huawei.com> Signed-off-by: Tejun Heo <tj@kernel.org>
1 parent 7ef70e4 commit e0e80a0

1 file changed

Lines changed: 2 additions & 11 deletions

File tree

kernel/cpuset.c

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2172,17 +2172,8 @@ static void cpuset_hotplug_workfn(struct work_struct *work)
21722172
flush_workqueue(cpuset_propagate_hotplug_wq);
21732173

21742174
/* rebuild sched domains if cpus_allowed has changed */
2175-
if (cpus_updated) {
2176-
struct sched_domain_attr *attr;
2177-
cpumask_var_t *doms;
2178-
int ndoms;
2179-
2180-
mutex_lock(&cpuset_mutex);
2181-
ndoms = generate_sched_domains(&doms, &attr);
2182-
mutex_unlock(&cpuset_mutex);
2183-
2184-
partition_sched_domains(ndoms, doms, attr);
2185-
}
2175+
if (cpus_updated)
2176+
rebuild_sched_domains();
21862177
}
21872178

21882179
void cpuset_update_active_cpus(bool cpu_online)

0 commit comments

Comments
 (0)