summaryrefslogtreecommitdiffstats
path: root/kernel/cpuset.c
diff options
context:
space:
mode:
authorLai Jiangshan <laijs@cn.fujitsu.com>2008-07-25 01:47:23 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-25 10:53:38 -0700
commit489a5393a20dcbf91104052120eb2eff8791b61b (patch)
tree63ed72ce1a7a5e4c5d361e8d1c7a876183d8bbf9 /kernel/cpuset.c
parentc372e817afc629fea9ff6321313325ed0b4a855b (diff)
downloadlinux-489a5393a20dcbf91104052120eb2eff8791b61b.tar.gz
linux-489a5393a20dcbf91104052120eb2eff8791b61b.tar.bz2
linux-489a5393a20dcbf91104052120eb2eff8791b61b.zip
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 <laijs@cn.fujitsu.com> Acked-by: Paul Menage <menage@google.com> Cc: Paul Jackson <pj@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/cpuset.c')
-rw-r--r--kernel/cpuset.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/kernel/cpuset.c b/kernel/cpuset.c
index 60d2c4702c6c..531b235e546f 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));