|
@@ -60,6 +60,14 @@
|
|
|
#include <linux/workqueue.h>
|
|
|
#include <linux/cgroup.h>
|
|
|
|
|
|
+/*
|
|
|
+ * Workqueue for cpuset related tasks.
|
|
|
+ *
|
|
|
+ * Using kevent workqueue may cause deadlock when memory_migrate
|
|
|
+ * is set. So we create a separate workqueue thread for cpuset.
|
|
|
+ */
|
|
|
+static struct workqueue_struct *cpuset_wq;
|
|
|
+
|
|
|
/*
|
|
|
* Tracks how many cpusets are currently defined in system.
|
|
|
* When there is only one cpuset (the root cpuset) we can
|
|
@@ -831,7 +839,7 @@ static DECLARE_WORK(rebuild_sched_domains_work, do_rebuild_sched_domains);
|
|
|
*/
|
|
|
static void async_rebuild_sched_domains(void)
|
|
|
{
|
|
|
- schedule_work(&rebuild_sched_domains_work);
|
|
|
+ queue_work(cpuset_wq, &rebuild_sched_domains_work);
|
|
|
}
|
|
|
|
|
|
/*
|
|
@@ -2111,6 +2119,9 @@ void __init cpuset_init_smp(void)
|
|
|
|
|
|
hotcpu_notifier(cpuset_track_online_cpus, 0);
|
|
|
hotplug_memory_notifier(cpuset_track_online_nodes, 10);
|
|
|
+
|
|
|
+ cpuset_wq = create_singlethread_workqueue("cpuset");
|
|
|
+ BUG_ON(!cpuset_wq);
|
|
|
}
|
|
|
|
|
|
/**
|