aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/cpuset.c
diff options
context:
space:
mode:
authorLi Zhong <zhong@linux.vnet.ibm.com>2013-04-27 09:52:43 -0400
committerTejun Heo <tj@kernel.org>2013-04-27 09:52:43 -0400
commite0e80a02e5701c8790bd348ab59edb154fbda60b (patch)
tree2fa0dc207322674ec0719857449971240d2b7e4e /kernel/cpuset.c
parent7ef70e48735e17d2be5c8e8f85052842b16b923a (diff)
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>
Diffstat (limited to 'kernel/cpuset.c')
-rw-r--r--kernel/cpuset.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/kernel/cpuset.c b/kernel/cpuset.c
index 866d78ee7930..8f0f45e002f2 100644
--- a/kernel/cpuset.c
+++ b/kernel/cpuset.c
@@ -2172,17 +2172,8 @@ static void cpuset_hotplug_workfn(struct work_struct *work)
2172 flush_workqueue(cpuset_propagate_hotplug_wq); 2172 flush_workqueue(cpuset_propagate_hotplug_wq);
2173 2173
2174 /* rebuild sched domains if cpus_allowed has changed */ 2174 /* rebuild sched domains if cpus_allowed has changed */
2175 if (cpus_updated) { 2175 if (cpus_updated)
2176 struct sched_domain_attr *attr; 2176 rebuild_sched_domains();
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 }
2186} 2177}
2187 2178
2188void cpuset_update_active_cpus(bool cpu_online) 2179void cpuset_update_active_cpus(bool cpu_online)