From: Gautham R Shenoy <ego@in.ibm.com>
To: "Vaidyanathan Srinivasan" <svaidy@linux.vnet.ibm.com>,
"Balbir Singh" <balbir@in.ibm.com>,
"Peter Zijlstra" <a.p.zijlstra@chello.nl>,
"Ingo Molnar" <mingo@elte.hu>,
"Suresh Siddha" <suresh.b.siddha@intel.com>
Cc: "Dipankar Sarma" <dipankar@in.ibm.com>,
efault@gmx.de, andi@firstfloor.org, linux-kernel@vger.kernel.org,
Gautham R Shenoy <ego@in.ibm.com>,
Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>
Subject: [PATCH 2 3/3] sched: Fix sd_parent_degenerate for SD_POWERSAVINGS_BALANCE.
Date: Tue, 03 Mar 2009 17:21:54 +0530 [thread overview]
Message-ID: <20090303115154.605.63799.stgit@sofia.in.ibm.com> (raw)
In-Reply-To: <20090303114648.605.86920.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>
Cc: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>
---
kernel/sched.c | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/kernel/sched.c b/kernel/sched.c
index 7d22a96..765e3e9 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -6957,6 +6957,20 @@ 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 SD_POWERSAVINGS_BALANCE
+ * check if it can be transferred to the new parent,
+ * and degenerate this domain. With a single
+ * group, it anyway can't contribute to power-aware load
+ * balancing.
+ */
+ 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;
next prev parent reply other threads:[~2009-03-03 11:52 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-03 11:51 [PATCH v2 0/3] sched: Extend sched_mc/smt_power_savings framework Gautham R Shenoy
2009-03-03 11:51 ` [PATCH 2 1/3] sched: code cleanup - sd_power_saving_flags(), sd_balance_for_mc/package_power() Gautham R Shenoy
2009-03-03 11:51 ` [PATCH 2 2/3] sched: Fix the wakeup nomination for sched_mc/smt_power_savings Gautham R Shenoy
2009-03-03 12:23 ` Peter Zijlstra
2009-03-03 13:59 ` Ingo Molnar
2009-03-03 15:45 ` Vaidyanathan Srinivasan
2009-03-03 15:48 ` Peter Zijlstra
2009-03-03 16:26 ` Ingo Molnar
2009-03-03 11:51 ` Gautham R Shenoy [this message]
2009-03-03 12:21 ` [PATCH v2 0/3] sched: Extend sched_mc/smt_power_savings framework Peter Zijlstra
2009-03-03 15:25 ` Vaidyanathan Srinivasan
2009-03-03 15:28 ` Peter Zijlstra
2009-03-04 11:06 ` Vaidyanathan Srinivasan
2009-03-04 11:38 ` Gautham R Shenoy
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=20090303115154.605.63799.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®