Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 107004
b: refs/heads/master
c: f539369
h: refs/heads/master
v: v3
  • Loading branch information
Lai Jiangshan authored and Linus Torvalds committed Jul 30, 2008
1 parent 636c72b commit a347069
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 5 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: 8d1e6266f512b3a94ef6d33528ff385f1aea0392
refs/heads/master: f5393693e96393131a4a2e2743f883986d508503
41 changes: 37 additions & 4 deletions trunk/kernel/cpuset.c
Original file line number Diff line number Diff line change
Expand Up @@ -486,13 +486,38 @@ static int cpusets_overlap(struct cpuset *a, struct cpuset *b)
static void
update_domain_attr(struct sched_domain_attr *dattr, struct cpuset *c)
{
if (!dattr)
return;
if (dattr->relax_domain_level < c->relax_domain_level)
dattr->relax_domain_level = c->relax_domain_level;
return;
}

static void
update_domain_attr_tree(struct sched_domain_attr *dattr, struct cpuset *c)
{
LIST_HEAD(q);

list_add(&c->stack_list, &q);
while (!list_empty(&q)) {
struct cpuset *cp;
struct cgroup *cont;
struct cpuset *child;

cp = list_first_entry(&q, struct cpuset, stack_list);
list_del(q.next);

if (cpus_empty(cp->cpus_allowed))
continue;

if (is_sched_load_balance(cp))
update_domain_attr(dattr, cp);

list_for_each_entry(cont, &cp->css.cgroup->children, sibling) {
child = cgroup_cs(cont);
list_add_tail(&child->stack_list, &q);
}
}
}

/*
* rebuild_sched_domains()
*
Expand Down Expand Up @@ -614,8 +639,16 @@ void rebuild_sched_domains(void)
if (cpus_empty(cp->cpus_allowed))
continue;

if (is_sched_load_balance(cp))
/*
* All child cpusets contain a subset of the parent's cpus, so
* just skip them, and then we call update_domain_attr_tree()
* to calc relax_domain_level of the corresponding sched
* domain.
*/
if (is_sched_load_balance(cp)) {
csa[csn++] = cp;
continue;
}

list_for_each_entry(cont, &cp->css.cgroup->children, sibling) {
child = cgroup_cs(cont);
Expand Down Expand Up @@ -686,7 +719,7 @@ void rebuild_sched_domains(void)
cpus_or(*dp, *dp, b->cpus_allowed);
b->pn = -1;
if (dattr)
update_domain_attr(dattr
update_domain_attr_tree(dattr
+ nslot, b);
}
}
Expand Down

0 comments on commit a347069

Please sign in to comment.