diff options
-rw-r--r-- | kernel/cpuset.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/kernel/cpuset.c b/kernel/cpuset.c index a841b5c01ef9..6012e326e856 100644 --- a/kernel/cpuset.c +++ b/kernel/cpuset.c | |||
@@ -1338,10 +1338,14 @@ static void cpuset_attach(struct cgroup_subsys *ss, | |||
1338 | struct cpuset *oldcs = cgroup_cs(oldcont); | 1338 | struct cpuset *oldcs = cgroup_cs(oldcont); |
1339 | int err; | 1339 | int err; |
1340 | 1340 | ||
1341 | mutex_lock(&callback_mutex); | 1341 | if (cs == &top_cpuset) { |
1342 | guarantee_online_cpus(cs, &cpus); | 1342 | cpus = cpu_possible_map; |
1343 | } else { | ||
1344 | mutex_lock(&callback_mutex); | ||
1345 | guarantee_online_cpus(cs, &cpus); | ||
1346 | mutex_unlock(&callback_mutex); | ||
1347 | } | ||
1343 | err = set_cpus_allowed_ptr(tsk, &cpus); | 1348 | err = set_cpus_allowed_ptr(tsk, &cpus); |
1344 | mutex_unlock(&callback_mutex); | ||
1345 | if (err) | 1349 | if (err) |
1346 | return; | 1350 | return; |
1347 | 1351 | ||