Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 127612
b: refs/heads/master
c: 2341d1b
h: refs/heads/master
v: v3
  • Loading branch information
Li Zefan authored and Linus Torvalds committed Jan 8, 2009
1 parent 357f6f9 commit 6ba2062
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5771f0a2236df69683e9abea87f35f522c97ff94
refs/heads/master: 2341d1b6598c7146d64a5050b53a72a5a819617f
14 changes: 9 additions & 5 deletions trunk/kernel/cpuset.c
Original file line number Diff line number Diff line change
Expand Up @@ -1306,6 +1306,9 @@ static int fmeter_getrate(struct fmeter *fmp)
return val;
}

/* Protected by cgroup_lock */
static cpumask_var_t cpus_attach;

/* Called by cgroups to determine if a cpuset is usable; cgroup_mutex held */
static int cpuset_can_attach(struct cgroup_subsys *ss,
struct cgroup *cont, struct task_struct *tsk)
Expand All @@ -1330,21 +1333,20 @@ static void cpuset_attach(struct cgroup_subsys *ss,
struct cgroup *cont, struct cgroup *oldcont,
struct task_struct *tsk)
{
cpumask_t cpus;
nodemask_t from, to;
struct mm_struct *mm;
struct cpuset *cs = cgroup_cs(cont);
struct cpuset *oldcs = cgroup_cs(oldcont);
int err;

if (cs == &top_cpuset) {
cpus = cpu_possible_map;
cpumask_copy(cpus_attach, cpu_possible_mask);
} else {
mutex_lock(&callback_mutex);
guarantee_online_cpus(cs, &cpus);
guarantee_online_cpus(cs, cpus_attach);
mutex_unlock(&callback_mutex);
}
err = set_cpus_allowed_ptr(tsk, &cpus);
err = set_cpus_allowed_ptr(tsk, cpus_attach);
if (err)
return;

Expand All @@ -1357,7 +1359,6 @@ static void cpuset_attach(struct cgroup_subsys *ss,
cpuset_migrate_mm(mm, &from, &to);
mmput(mm);
}

}

/* The various types of files and directories in a cpuset file system */
Expand Down Expand Up @@ -1838,6 +1839,9 @@ int __init cpuset_init(void)
if (err < 0)
return err;

if (!alloc_cpumask_var(&cpus_attach, GFP_KERNEL))
BUG();

number_of_cpusets = 1;
return 0;
}
Expand Down

0 comments on commit 6ba2062

Please sign in to comment.