From: Lai Jiangshan <laijs@cn.fujitsu.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Paul Jackson <pj@sgi.com>, Paul Menage <menage@google.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [PATCH 1/3] cpuset: Don't pass empty cpumasks to partition_sched_domains()
Date: Wed, 16 Jul 2008 11:43:05 +0800 [thread overview]
Message-ID: <487D6E49.7070805@cn.fujitsu.com> (raw)
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@cn.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));
next reply other threads:[~2008-07-16 3:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-16 3:43 Lai Jiangshan [this message]
2008-07-16 7:14 ` [PATCH 1/3] cpuset: Don't pass empty cpumasks to partition_sched_domains() Paul Menage
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=487D6E49.7070805@cn.fujitsu.com \
--to=laijs@cn.fujitsu.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=menage@google.com \
--cc=pj@sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.