Skip to content

Commit

Permalink
cpuset: use rebuild_sched_domains() in cpuset_hotplug_workfn()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Li Zhong authored and Tejun Heo committed Apr 27, 2013
1 parent 7ef70e4 commit e0e80a0
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions kernel/cpuset.c
Original file line number Diff line number Diff line change
Expand Up @@ -2172,17 +2172,8 @@ static void cpuset_hotplug_workfn(struct work_struct *work)
flush_workqueue(cpuset_propagate_hotplug_wq);

/* rebuild sched domains if cpus_allowed has changed */
if (cpus_updated) {
struct sched_domain_attr *attr;
cpumask_var_t *doms;
int ndoms;

mutex_lock(&cpuset_mutex);
ndoms = generate_sched_domains(&doms, &attr);
mutex_unlock(&cpuset_mutex);

partition_sched_domains(ndoms, doms, attr);
}
if (cpus_updated)
rebuild_sched_domains();
}

void cpuset_update_active_cpus(bool cpu_online)
Expand Down

0 comments on commit e0e80a0

Please sign in to comment.