aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/cpuset.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/cpuset.c')
-rw-r--r--kernel/cpuset.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/kernel/cpuset.c b/kernel/cpuset.c
index d753837cca33..dbef832e5e2d 100644
--- a/kernel/cpuset.c
+++ b/kernel/cpuset.c
@@ -1407,8 +1407,7 @@ static cpumask_var_t cpus_attach;
1407 1407
1408static void cpuset_attach(struct cgroup *cgrp, struct cgroup_taskset *tset) 1408static void cpuset_attach(struct cgroup *cgrp, struct cgroup_taskset *tset)
1409{ 1409{
1410 /* static bufs protected by cpuset_mutex */ 1410 /* static buf protected by cpuset_mutex */
1411 static nodemask_t cpuset_attach_nodemask_from;
1412 static nodemask_t cpuset_attach_nodemask_to; 1411 static nodemask_t cpuset_attach_nodemask_to;
1413 struct mm_struct *mm; 1412 struct mm_struct *mm;
1414 struct task_struct *task; 1413 struct task_struct *task;
@@ -1442,13 +1441,12 @@ static void cpuset_attach(struct cgroup *cgrp, struct cgroup_taskset *tset)
1442 * Change mm, possibly for multiple threads in a threadgroup. This is 1441 * Change mm, possibly for multiple threads in a threadgroup. This is
1443 * expensive and may sleep. 1442 * expensive and may sleep.
1444 */ 1443 */
1445 cpuset_attach_nodemask_from = oldcs->mems_allowed;
1446 cpuset_attach_nodemask_to = cs->mems_allowed; 1444 cpuset_attach_nodemask_to = cs->mems_allowed;
1447 mm = get_task_mm(leader); 1445 mm = get_task_mm(leader);
1448 if (mm) { 1446 if (mm) {
1449 mpol_rebind_mm(mm, &cpuset_attach_nodemask_to); 1447 mpol_rebind_mm(mm, &cpuset_attach_nodemask_to);
1450 if (is_memory_migrate(cs)) 1448 if (is_memory_migrate(cs))
1451 cpuset_migrate_mm(mm, &cpuset_attach_nodemask_from, 1449 cpuset_migrate_mm(mm, &oldcs->mems_allowed,
1452 &cpuset_attach_nodemask_to); 1450 &cpuset_attach_nodemask_to);
1453 mmput(mm); 1451 mmput(mm);
1454 } 1452 }