public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] cpuset: Don't pass empty cpumasks to partition_sched_domains()
@ 2008-07-16  3:43 Lai Jiangshan
  2008-07-16  7:14 ` Paul Menage
  0 siblings, 1 reply; 2+ messages in thread
From: Lai Jiangshan @ 2008-07-16  3:43 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Paul Jackson, Paul Menage, Linux Kernel Mailing List

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));







^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/3] cpuset: Don't pass empty cpumasks to partition_sched_domains()
  2008-07-16  3:43 [PATCH 1/3] cpuset: Don't pass empty cpumasks to partition_sched_domains() Lai Jiangshan
@ 2008-07-16  7:14 ` Paul Menage
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Menage @ 2008-07-16  7:14 UTC (permalink / raw)
  To: Lai Jiangshan; +Cc: Andrew Morton, Paul Jackson, Linux Kernel Mailing List

On Tue, Jul 15, 2008 at 8:43 PM, Lai Jiangshan <laijs@cn.fujitsu.com> wrote:
> 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>

Acked-by: Paul Menage <menage@google.com>

Seems reasonable, and I don't think that it clashes with the other
outstanding rebuild_sched_domains() patches.

Paul

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-07-16  7:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-16  3:43 [PATCH 1/3] cpuset: Don't pass empty cpumasks to partition_sched_domains() Lai Jiangshan
2008-07-16  7:14 ` Paul Menage

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox