diff options
-rw-r--r-- | kernel/cpuset.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/kernel/cpuset.c b/kernel/cpuset.c index 6868c1e78917..67b2bfe27814 100644 --- a/kernel/cpuset.c +++ b/kernel/cpuset.c | |||
@@ -1709,7 +1709,8 @@ static void remove_tasks_in_empty_cpuset(struct cpuset *cs) | |||
1709 | * has online cpus, so can't be empty). | 1709 | * has online cpus, so can't be empty). |
1710 | */ | 1710 | */ |
1711 | parent = cs->parent; | 1711 | parent = cs->parent; |
1712 | while (cpus_empty(parent->cpus_allowed)) | 1712 | while (cpus_empty(parent->cpus_allowed) || |
1713 | nodes_empty(parent->mems_allowed)) | ||
1713 | parent = parent->parent; | 1714 | parent = parent->parent; |
1714 | 1715 | ||
1715 | move_member_tasks_to_cpuset(cs, parent); | 1716 | move_member_tasks_to_cpuset(cs, parent); |
@@ -1741,7 +1742,6 @@ static void scan_for_empty_cpusets(const struct cpuset *root) | |||
1741 | 1742 | ||
1742 | list_add_tail((struct list_head *)&root->stack_list, &queue); | 1743 | list_add_tail((struct list_head *)&root->stack_list, &queue); |
1743 | 1744 | ||
1744 | mutex_lock(&callback_mutex); | ||
1745 | while (!list_empty(&queue)) { | 1745 | while (!list_empty(&queue)) { |
1746 | cp = container_of(queue.next, struct cpuset, stack_list); | 1746 | cp = container_of(queue.next, struct cpuset, stack_list); |
1747 | list_del(queue.next); | 1747 | list_del(queue.next); |
@@ -1750,19 +1750,24 @@ static void scan_for_empty_cpusets(const struct cpuset *root) | |||
1750 | list_add_tail(&child->stack_list, &queue); | 1750 | list_add_tail(&child->stack_list, &queue); |
1751 | } | 1751 | } |
1752 | cont = cp->css.cgroup; | 1752 | cont = cp->css.cgroup; |
1753 | |||
1754 | /* Continue past cpusets with all cpus, mems online */ | ||
1755 | if (cpus_subset(cp->cpus_allowed, cpu_online_map) && | ||
1756 | nodes_subset(cp->mems_allowed, node_states[N_HIGH_MEMORY])) | ||
1757 | continue; | ||
1758 | |||
1753 | /* Remove offline cpus and mems from this cpuset. */ | 1759 | /* Remove offline cpus and mems from this cpuset. */ |
1760 | mutex_lock(&callback_mutex); | ||
1754 | cpus_and(cp->cpus_allowed, cp->cpus_allowed, cpu_online_map); | 1761 | cpus_and(cp->cpus_allowed, cp->cpus_allowed, cpu_online_map); |
1755 | nodes_and(cp->mems_allowed, cp->mems_allowed, | 1762 | nodes_and(cp->mems_allowed, cp->mems_allowed, |
1756 | node_states[N_HIGH_MEMORY]); | 1763 | node_states[N_HIGH_MEMORY]); |
1764 | mutex_unlock(&callback_mutex); | ||
1765 | |||
1766 | /* Move tasks from the empty cpuset to a parent */ | ||
1757 | if (cpus_empty(cp->cpus_allowed) || | 1767 | if (cpus_empty(cp->cpus_allowed) || |
1758 | nodes_empty(cp->mems_allowed)) { | 1768 | nodes_empty(cp->mems_allowed)) |
1759 | /* Move tasks from the empty cpuset to a parent */ | ||
1760 | mutex_unlock(&callback_mutex); | ||
1761 | remove_tasks_in_empty_cpuset(cp); | 1769 | remove_tasks_in_empty_cpuset(cp); |
1762 | mutex_lock(&callback_mutex); | ||
1763 | } | ||
1764 | } | 1770 | } |
1765 | mutex_unlock(&callback_mutex); | ||
1766 | } | 1771 | } |
1767 | 1772 | ||
1768 | /* | 1773 | /* |