]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - kernel/cgroup/cpuset.c
Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
[linux.git] / kernel / cgroup / cpuset.c
index 6a1942ed781c5b1712021299fb8227d389126c00..515525ff1cfd32bd9cd27fa1b0d7a06f0cda5064 100644 (file)
@@ -3254,10 +3254,23 @@ void cpuset_cpus_allowed(struct task_struct *tsk, struct cpumask *pmask)
        spin_unlock_irqrestore(&callback_lock, flags);
 }
 
+/**
+ * cpuset_cpus_allowed_fallback - final fallback before complete catastrophe.
+ * @tsk: pointer to task_struct with which the scheduler is struggling
+ *
+ * Description: In the case that the scheduler cannot find an allowed cpu in
+ * tsk->cpus_allowed, we fall back to task_cs(tsk)->cpus_allowed. In legacy
+ * mode however, this value is the same as task_cs(tsk)->effective_cpus,
+ * which will not contain a sane cpumask during cases such as cpu hotplugging.
+ * This is the absolute last resort for the scheduler and it is only used if
+ * _every_ other avenue has been traveled.
+ **/
+
 void cpuset_cpus_allowed_fallback(struct task_struct *tsk)
 {
        rcu_read_lock();
-       do_set_cpus_allowed(tsk, task_cs(tsk)->effective_cpus);
+       do_set_cpus_allowed(tsk, is_in_v2_mode() ?
+               task_cs(tsk)->cpus_allowed : cpu_possible_mask);
        rcu_read_unlock();
 
        /*