From: Li Zhong Date: Sat, 27 Apr 2013 13:52:43 +0000 (-0700) Subject: cpuset: use rebuild_sched_domains() in cpuset_hotplug_workfn() X-Git-Tag: upstream/snapshot3+hdmi~5277^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e0e80a02e5701c8790bd348ab59edb154fbda60b;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git 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 Signed-off-by: Li Zefan Signed-off-by: Tejun Heo --- diff --git a/kernel/cpuset.c b/kernel/cpuset.c index 866d78e..8f0f45e 100644 --- a/kernel/cpuset.c +++ b/kernel/cpuset.c @@ -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)