[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <487D6E49.7070805@cn.fujitsu.com>
Date: Wed, 16 Jul 2008 11:43:05 +0800
From: Lai Jiangshan <laijs@...fujitsu.com>
To: Andrew Morton <akpm@...ux-foundation.org>
CC: Paul Jackson <pj@....com>, Paul Menage <menage@...gle.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: [PATCH 1/3] cpuset: Don't pass empty cpumasks to partition_sched_domains()
i create a lots of empty cpusets(empty cpumasks) and
turn off the "sched_load_balance" in top cpuset.
And 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@...fujitsu.com>
---
diff --git a/kernel/cpuset.c b/kernel/cpuset.c
index 798b3ab..1fbd52c 100644
--- a/kernel/cpuset.c
+++ b/kernel/cpuset.c
@@ -609,8 +609,13 @@ static 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));
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists