diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c index 55db72dae219..2ecf089a9ecb 100644 --- a/kernel/cgroup/cpuset.c +++ b/kernel/cgroup/cpuset.c @@ -3341,14 +3341,17 @@ void cpuset_cpus_allowed(struct task_struct *tsk, struct cpumask *pmask) void cpuset_cpus_allowed_fallback(struct task_struct *tsk) { - const struct cpumask *cs_mask = task_cs(tsk)->cpus_allowed; const struct cpumask *possible_mask = task_cpu_possible_mask(tsk); - - if (!is_in_v2_mode() || !cpumask_subset(cs_mask, possible_mask)) - return; /* select_fallback_rq will try harder */ + const struct cpumask *cs_mask; rcu_read_lock(); + cs_mask = task_cs(tsk)->cpus_allowed; + + if (!is_in_v2_mode() || !cpumask_subset(cs_mask, possible_mask)) + goto unlock; /* select_fallback_rq will try harder */ + do_set_cpus_allowed(tsk, cs_mask); +unlock: rcu_read_unlock(); /*