From: Gautham R Shenoy <ego@in.ibm.com>
To: linux-kernel@vger.kernel.org, svaidy@linux.vnet.ibm.com,
mingo@elte.hu, a.p.zijlstra@chello.nl, suresh.b.siddha@intel.com,
ego@in.ibm.com
Cc: balbir@in.ibm.com, dipankar@in.ibm.com, efault@gmx.de,
andi@firstfloor.org, Gautham R Shenoy <ego@in.ibm.com>
Subject: [PATCH 3/3] sched: Fix sd_parent_degenerate for SD_POWERSAVINGS_BALANCE.
Date: Mon, 16 Feb 2009 22:21:16 +0530 [thread overview]
Message-ID: <20090216165116.12804.90036.stgit@sofia.in.ibm.com> (raw)
In-Reply-To: <20090216164719.12804.37013.stgit@sofia.in.ibm.com>
Currently a sched_domain having a single group can be prevented from getting
degenerated if it contains a SD_POWERSAVINGS_BALANCE flag. But since it has
only one group, it won't have any scope for performing powersavings balance as
it does not have a sibling group to pull from.
Apart from not provide any powersavings, it also fails to participate
in normal load-balancing.
Fix this by allowing such a sched_domain to degenerate and pass on the
responsibility of performing the POWERSAVINGS_BALANCE to it's parent domain.
Signed-off-by: Gautham R Shenoy <ego@in.ibm.com>
---
kernel/sched.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/kernel/sched.c b/kernel/sched.c
index af88f5a..32858fd 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -6934,6 +6934,17 @@ sd_parent_degenerate(struct sched_domain *sd, struct sched_domain *parent)
SD_SHARE_PKG_RESOURCES);
if (nr_node_ids == 1)
pflags &= ~SD_SERIALIZE;
+
+ /*
+ * If the only flag that is preventing us from degenerating
+ * a domain with a single group is power_savings balance,
+ * see if we can transfer that responsibility to the new parent
+ */
+ if (pflags & SD_POWERSAVINGS_BALANCE && parent->parent) {
+ pflags &= ~SD_POWERSAVINGS_BALANCE;
+ parent->parent->flags |=
+ sd_power_saving_flags(parent->level);
+ }
}
if (~cflags & pflags)
return 0;
prev parent reply other threads:[~2009-02-16 16:52 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-16 16:51 [PATCH 0/3] sched: Extend sched_mc/smt_power_savings framework Gautham R Shenoy
2009-02-16 16:51 ` [PATCH 1/3] sched: code cleanup - sd_power_saving_flags(), sd_balance_for_mc/package_power() Gautham R Shenoy
2009-02-16 17:43 ` Peter Zijlstra
2009-02-17 6:55 ` Gautham R Shenoy
2009-02-16 16:51 ` [PATCH 2/3] sched: Fix the wakeup nomination for sched_mc/smt_power_savings Gautham R Shenoy
2009-02-16 17:44 ` Peter Zijlstra
2009-02-16 17:45 ` Peter Zijlstra
2009-02-17 6:59 ` Gautham R Shenoy
2009-02-16 16:51 ` Gautham R Shenoy [this message]
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=20090216165116.12804.90036.stgit@sofia.in.ibm.com \
--to=ego@in.ibm.com \
--cc=a.p.zijlstra@chello.nl \
--cc=andi@firstfloor.org \
--cc=balbir@in.ibm.com \
--cc=dipankar@in.ibm.com \
--cc=efault@gmx.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=suresh.b.siddha@intel.com \
--cc=svaidy@linux.vnet.ibm.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.