Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 83809
b: refs/heads/master
c: b450129
h: refs/heads/master
i:
  83807: bd508a1
v: v3
  • Loading branch information
Paul Jackson authored and Linus Torvalds committed Feb 7, 2008
1 parent 599912f commit 0484507
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 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: c8d9c90c7ece28259436476a016cdecd25dccf2c
refs/heads/master: b450129554213a4d4c5932f8a293646c029e1b0a
21 changes: 13 additions & 8 deletions trunk/kernel/cpuset.c
Original file line number Diff line number Diff line change
Expand Up @@ -1709,7 +1709,8 @@ static void remove_tasks_in_empty_cpuset(struct cpuset *cs)
* has online cpus, so can't be empty).
*/
parent = cs->parent;
while (cpus_empty(parent->cpus_allowed))
while (cpus_empty(parent->cpus_allowed) ||
nodes_empty(parent->mems_allowed))
parent = parent->parent;

move_member_tasks_to_cpuset(cs, parent);
Expand Down Expand Up @@ -1741,7 +1742,6 @@ static void scan_for_empty_cpusets(const struct cpuset *root)

list_add_tail((struct list_head *)&root->stack_list, &queue);

mutex_lock(&callback_mutex);
while (!list_empty(&queue)) {
cp = container_of(queue.next, struct cpuset, stack_list);
list_del(queue.next);
Expand All @@ -1750,19 +1750,24 @@ static void scan_for_empty_cpusets(const struct cpuset *root)
list_add_tail(&child->stack_list, &queue);
}
cont = cp->css.cgroup;

/* Continue past cpusets with all cpus, mems online */
if (cpus_subset(cp->cpus_allowed, cpu_online_map) &&
nodes_subset(cp->mems_allowed, node_states[N_HIGH_MEMORY]))
continue;

/* Remove offline cpus and mems from this cpuset. */
mutex_lock(&callback_mutex);
cpus_and(cp->cpus_allowed, cp->cpus_allowed, cpu_online_map);
nodes_and(cp->mems_allowed, cp->mems_allowed,
node_states[N_HIGH_MEMORY]);
mutex_unlock(&callback_mutex);

/* Move tasks from the empty cpuset to a parent */
if (cpus_empty(cp->cpus_allowed) ||
nodes_empty(cp->mems_allowed)) {
/* Move tasks from the empty cpuset to a parent */
mutex_unlock(&callback_mutex);
nodes_empty(cp->mems_allowed))
remove_tasks_in_empty_cpuset(cp);
mutex_lock(&callback_mutex);
}
}
mutex_unlock(&callback_mutex);
}

/*
Expand Down

0 comments on commit 0484507

Please sign in to comment.