]> Pileus Git - ~andy/linux/blobdiff - kernel/cpuset.c
Merge branch 'for-3.10' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup
[~andy/linux] / kernel / cpuset.c
index 9bd30b9c430c924ffcaa8cc840d9a7b40db639f5..12331120767ca7ebdfe0e1cede044280c042c6db 100644 (file)
@@ -1378,16 +1378,16 @@ static int cpuset_can_attach(struct cgroup *cgrp, struct cgroup_taskset *tset)
 
        cgroup_taskset_for_each(task, cgrp, tset) {
                /*
-                * Kthreads bound to specific cpus cannot be moved to a new
-                * cpuset; we cannot change their cpu affinity and
-                * isolating such threads by their set of allowed nodes is
-                * unnecessary.  Thus, cpusets are not applicable for such
-                * threads.  This prevents checking for success of
-                * set_cpus_allowed_ptr() on all attached tasks before
-                * cpus_allowed may be changed.
+                * Kthreads which disallow setaffinity shouldn't be moved
+                * to a new cpuset; we don't want to change their cpu
+                * affinity and isolating such threads by their set of
+                * allowed nodes is unnecessary.  Thus, cpusets are not
+                * applicable for such threads.  This prevents checking for
+                * success of set_cpus_allowed_ptr() on all attached tasks
+                * before cpus_allowed may be changed.
                 */
                ret = -EINVAL;
-               if (task->flags & PF_THREAD_BOUND)
+               if (task->flags & PF_NO_SETAFFINITY)
                        goto out_unlock;
                ret = security_task_setscheduler(task);
                if (ret)
@@ -2193,7 +2193,6 @@ void cpuset_update_active_cpus(bool cpu_online)
        schedule_work(&cpuset_hotplug_work);
 }
 
-#ifdef CONFIG_MEMORY_HOTPLUG
 /*
  * Keep top_cpuset.mems_allowed tracking node_states[N_MEMORY].
  * Call this routine anytime after node_states[N_MEMORY] changes.
@@ -2205,20 +2204,23 @@ static int cpuset_track_online_nodes(struct notifier_block *self,
        schedule_work(&cpuset_hotplug_work);
        return NOTIFY_OK;
 }
-#endif
+
+static struct notifier_block cpuset_track_online_nodes_nb = {
+       .notifier_call = cpuset_track_online_nodes,
+       .priority = 10,         /* ??! */
+};
 
 /**
  * cpuset_init_smp - initialize cpus_allowed
  *
  * Description: Finish top cpuset after cpu, node maps are initialized
- **/
-
+ */
 void __init cpuset_init_smp(void)
 {
        cpumask_copy(top_cpuset.cpus_allowed, cpu_active_mask);
        top_cpuset.mems_allowed = node_states[N_MEMORY];
 
-       hotplug_memory_notifier(cpuset_track_online_nodes, 10);
+       register_hotmemory_notifier(&cpuset_track_online_nodes_nb);
 
        cpuset_propagate_hotplug_wq =
                alloc_ordered_workqueue("cpuset_hotplug", 0);