linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH cpuset] Use rebuild_sched_domains() in cpuset_hotplug_workfn()
@ 2013-04-02  7:16 Li Zhong
  2013-04-03  9:32 ` Li Zefan
  0 siblings, 1 reply; 6+ messages in thread
From: Li Zhong @ 2013-04-02  7:16 UTC (permalink / raw)
  To: linux-kernel; +Cc: lizefan, tj

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>
---
 kernel/cpuset.c |   13 ++-----------
 1 files changed, 2 insertions(+), 11 deletions(-)

diff --git a/kernel/cpuset.c b/kernel/cpuset.c
index 4f9dfe4..515a713 100644
--- a/kernel/cpuset.c
+++ b/kernel/cpuset.c
@@ -2222,17 +2222,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)



^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-04-12 10:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-02  7:16 [PATCH cpuset] Use rebuild_sched_domains() in cpuset_hotplug_workfn() Li Zhong
2013-04-03  9:32 ` Li Zefan
2013-04-08  9:51   ` Li Zhong
2013-04-09  9:59     ` [RFC PATCH v2 cpuset] Don't pass offlined cpus to partition_sched_domains() Li Zhong
2013-04-11  8:57       ` Li Zefan
2013-04-12 10:11         ` Li Zhong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).