From: Lai Jiangshan Date: Fri, 25 Jul 2008 08:47:23 +0000 (-0700) Subject: cpuset: don't pass empty cpumasks to partition_sched_domains() X-Git-Tag: v2.6.27-rc1~365 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=489a5393a20dcbf91104052120eb2eff8791b61b;p=platform%2Fkernel%2Flinux-3.10.git 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: Lai Jiangshan Acked-by: Paul Menage Cc: Paul Jackson Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/kernel/cpuset.c b/kernel/cpuset.c index 60d2c47..531b235 100644 --- a/kernel/cpuset.c +++ b/kernel/cpuset.c @@ -610,8 +610,13 @@ void rebuild_sched_domains(void) while (__kfifo_get(q, (void *)&cp, sizeof(cp))) { struct cgroup *cont; struct cpuset *child; /* scans child cpusets of cp */ + + if (cpus_empty(cp->cpus_allowed)) + continue; + if (is_sched_load_balance(cp)) csa[csn++] = cp; + list_for_each_entry(cont, &cp->css.cgroup->children, sibling) { child = cgroup_cs(cont); __kfifo_put(q, (void *)&child, sizeof(cp));