Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 188918
b: refs/heads/master
c: 5ab116c
h: refs/heads/master
v: v3
  • Loading branch information
Miao Xie authored and Linus Torvalds committed Mar 24, 2010
1 parent 7ca958b commit 88dba39
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 11 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: 5574169613b40b85d6f4c67208fa4846b897a0a1
refs/heads/master: 5ab116c9349ef52d6fbd2e2917a53f13194b048e
2 changes: 1 addition & 1 deletion trunk/init/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,7 @@ static int __init kernel_init(void * unused)
/*
* init can allocate pages on any node
*/
set_mems_allowed(node_possible_map);
set_mems_allowed(node_states[N_HIGH_MEMORY]);
/*
* init can run on any cpu.
*/
Expand Down
20 changes: 12 additions & 8 deletions trunk/kernel/cpuset.c
Original file line number Diff line number Diff line change
Expand Up @@ -920,9 +920,6 @@ static int update_cpumask(struct cpuset *cs, struct cpuset *trialcs,
* call to guarantee_online_mems(), as we know no one is changing
* our task's cpuset.
*
* Hold callback_mutex around the two modifications of our tasks
* mems_allowed to synchronize with cpuset_mems_allowed().
*
* While the mm_struct we are migrating is typically from some
* other task, the task_struct mems_allowed that we are hacking
* is for our current task, which must allocate new pages for that
Expand Down Expand Up @@ -1391,11 +1388,10 @@ static void cpuset_attach(struct cgroup_subsys *ss, struct cgroup *cont,

if (cs == &top_cpuset) {
cpumask_copy(cpus_attach, cpu_possible_mask);
to = node_possible_map;
} else {
guarantee_online_cpus(cs, cpus_attach);
guarantee_online_mems(cs, &to);
}
guarantee_online_mems(cs, &to);

/* do per-task migration stuff possibly for each in the threadgroup */
cpuset_attach_task(tsk, &to, cs);
Expand Down Expand Up @@ -2090,15 +2086,23 @@ static int cpuset_track_online_cpus(struct notifier_block *unused_nb,
static int cpuset_track_online_nodes(struct notifier_block *self,
unsigned long action, void *arg)
{
nodemask_t oldmems;

cgroup_lock();
switch (action) {
case MEM_ONLINE:
case MEM_OFFLINE:
oldmems = top_cpuset.mems_allowed;
mutex_lock(&callback_mutex);
top_cpuset.mems_allowed = node_states[N_HIGH_MEMORY];
mutex_unlock(&callback_mutex);
if (action == MEM_OFFLINE)
scan_for_empty_cpusets(&top_cpuset);
update_tasks_nodemask(&top_cpuset, &oldmems, NULL);
break;
case MEM_OFFLINE:
/*
* needn't update top_cpuset.mems_allowed explicitly because
* scan_for_empty_cpusets() will update it.
*/
scan_for_empty_cpusets(&top_cpuset);
break;
default:
break;
Expand Down
2 changes: 1 addition & 1 deletion trunk/kernel/kthread.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ int kthreadd(void *unused)
set_task_comm(tsk, "kthreadd");
ignore_signals(tsk);
set_cpus_allowed_ptr(tsk, cpu_all_mask);
set_mems_allowed(node_possible_map);
set_mems_allowed(node_states[N_HIGH_MEMORY]);

current->flags |= PF_NOFREEZE | PF_FREEZER_NOSIG;

Expand Down

0 comments on commit 88dba39

Please sign in to comment.