Commit 489a5393 authored by Lai Jiangshan's avatar Lai Jiangshan Committed by Linus Torvalds

cpuset: don't pass empty cpumasks to partition_sched_domains()

I create lots of empty cpusets(empty cpumasks) and turn off the
"sched_load_balance" in top cpuset.

I found that all these empty cpumasks are passed to
partition_sched_domains() in rebuild_sched_domains(), it's very
time-consuming for partition_sched_domains() and it's not need.

It also reduce memory consumed and some works in rebuild_sched_domains()
too.
Signed-off-by: default avatarLai Jiangshan <laijs@cn.fujitsu.com>
Acked-by: default avatarPaul Menage <menage@google.com>
Cc: Paul Jackson <pj@sgi.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent c372e817
...@@ -610,8 +610,13 @@ void rebuild_sched_domains(void) ...@@ -610,8 +610,13 @@ void rebuild_sched_domains(void)
while (__kfifo_get(q, (void *)&cp, sizeof(cp))) { while (__kfifo_get(q, (void *)&cp, sizeof(cp))) {
struct cgroup *cont; struct cgroup *cont;
struct cpuset *child; /* scans child cpusets of cp */ struct cpuset *child; /* scans child cpusets of cp */
if (cpus_empty(cp->cpus_allowed))
continue;
if (is_sched_load_balance(cp)) if (is_sched_load_balance(cp))
csa[csn++] = cp; csa[csn++] = cp;
list_for_each_entry(cont, &cp->css.cgroup->children, sibling) { list_for_each_entry(cont, &cp->css.cgroup->children, sibling) {
child = cgroup_cs(cont); child = cgroup_cs(cont);
__kfifo_put(q, (void *)&child, sizeof(cp)); __kfifo_put(q, (void *)&child, sizeof(cp));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment