Skip to content

Commit

Permalink
Merge branch 'for-4.0-fixes' of git://git.kernel.org/pub/scm/linux/ke…
Browse files Browse the repository at this point in the history
…rnel/git/tj/cgroup

Pull cgroup fixes from Tejun Heo:
 "The cgroup iteration update two years ago and the recent cpuset
  restructuring introduced regressions in subset of cpuset
  configurations.  Three patches to fix them.

  All are marked for -stable"

* 'for-4.0-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup:
  cpuset: Fix cpuset sched_relax_domain_level
  cpuset: fix a warning when clearing configured masks in old hierarchy
  cpuset: initialize effective masks when clone_children is enabled
  • Loading branch information
torvalds committed Mar 10, 2015
2 parents f930713 + 283cb41 commit c0e99a7
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions kernel/cpuset.c
Original file line number Diff line number Diff line change
Expand Up @@ -548,9 +548,6 @@ static void update_domain_attr_tree(struct sched_domain_attr *dattr,

rcu_read_lock();
cpuset_for_each_descendant_pre(cp, pos_css, root_cs) {
if (cp == root_cs)
continue;

/* skip the whole subtree if @cp doesn't have any CPU */
if (cpumask_empty(cp->cpus_allowed)) {
pos_css = css_rightmost_descendant(pos_css);
Expand Down Expand Up @@ -873,7 +870,7 @@ static void update_cpumasks_hier(struct cpuset *cs, struct cpumask *new_cpus)
* If it becomes empty, inherit the effective mask of the
* parent, which is guaranteed to have some CPUs.
*/
if (cpumask_empty(new_cpus))
if (cgroup_on_dfl(cp->css.cgroup) && cpumask_empty(new_cpus))
cpumask_copy(new_cpus, parent->effective_cpus);

/* Skip the whole subtree if the cpumask remains the same. */
Expand Down Expand Up @@ -1129,7 +1126,7 @@ static void update_nodemasks_hier(struct cpuset *cs, nodemask_t *new_mems)
* If it becomes empty, inherit the effective mask of the
* parent, which is guaranteed to have some MEMs.
*/
if (nodes_empty(*new_mems))
if (cgroup_on_dfl(cp->css.cgroup) && nodes_empty(*new_mems))
*new_mems = parent->effective_mems;

/* Skip the whole subtree if the nodemask remains the same. */
Expand Down Expand Up @@ -1979,7 +1976,9 @@ static int cpuset_css_online(struct cgroup_subsys_state *css)

spin_lock_irq(&callback_lock);
cs->mems_allowed = parent->mems_allowed;
cs->effective_mems = parent->mems_allowed;
cpumask_copy(cs->cpus_allowed, parent->cpus_allowed);
cpumask_copy(cs->effective_cpus, parent->cpus_allowed);
spin_unlock_irq(&callback_lock);
out_unlock:
mutex_unlock(&cpuset_mutex);
Expand Down

0 comments on commit c0e99a7

Please sign in to comment.