From: Gautham R Shenoy <ego@in.ibm.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Andreas Herrmann <andreas.herrmann3@amd.com>,
Ingo Molnar <mingo@elte.hu>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 9/15] sched: Check sched_mn_power_savings when setting flags for CPU and MN domains
Date: Tue, 25 Aug 2009 15:04:42 +0530 [thread overview]
Message-ID: <20090825093442.GB4268@in.ibm.com> (raw)
In-Reply-To: <1251125862.7538.270.camel@twins>
On Mon, Aug 24, 2009 at 04:57:42PM +0200, Peter Zijlstra wrote:
> On Thu, 2009-08-20 at 15:40 +0200, Andreas Herrmann wrote:
> > Use new function sd_balance_for_mn_power() and adapt
> > sd_balance_for_package_power() and sd_power_saving_flags() for correct
> > setting of flags SD_POWERSAVINGS_BALANCE and SD_BALANCE_NEWIDLE in CPU
> > and MN domains.
> >
> > Furthermore add flag SD_SHARE_PKG_RESOURCES to MN domain.
> > Rational: a multi-node processor most likely shares package resources
> > (on Magny-Cours the package constitues a "voltage domain").
>
> IIRC SD_SHARE_PKG_RESOURCES plays games with the cpu_pwer of a
> sched_domain, which breaks in all kinds of curious ways, this adds more
> breakage afaict.
>
> ego?
A domain which has SD_SHARE_PKG_RESOURCES, will always have the
__cpu_power = SD_LOAD_SCALE if the domain hasn't set
SD_POWERSAVINGS_BALANCE flag.
The problem which you are talking about is
when you offline a CPU of such a domain, it will still show the same
cpu_power, which can confuse the scheduler.
Eg:
A Dual socket Dual core machine, in the absense of
SD_POWERSAVINGS_BALANCE the SD_LV_CPU which has SD_SHARE_PKG_RESOURCES
set will have both of it's group->cpu_power set to SD_LOAD_SCALE.
If we offline, say one of the four cores,
the group->cpu_power the corresponding group will will still be SD_LOAD_SCALE.
This might affect the fairness calculations. For eg, if you have 6 tasks
running, the ideal placement should have been 4 on the socket whose CPUs
are online and 2 on which one of the cpus has been offlined. But in this
case, we will have 3 + 3, which is not correct.
>
> > Signed-off-by: Andreas Herrmann <andreas.herrmann3@amd.com>
> > ---
> > arch/x86/include/asm/topology.h | 3 ++-
> > include/linux/sched.h | 14 ++++++++++++--
> > 2 files changed, 14 insertions(+), 3 deletions(-)
> >
> > diff --git a/arch/x86/include/asm/topology.h b/arch/x86/include/asm/topology.h
> > index 6d7d133..4a520b8 100644
> > --- a/arch/x86/include/asm/topology.h
> > +++ b/arch/x86/include/asm/topology.h
> > @@ -198,7 +198,8 @@ static inline void setup_node_to_cpumask_map(void) { }
> > | SD_BALANCE_EXEC \
> > | SD_WAKE_AFFINE \
> > | SD_WAKE_BALANCE \
> > - | sd_balance_for_package_power()\
> > + | SD_SHARE_PKG_RESOURCES\
> > + | sd_balance_for_mn_power()\
> > | sd_power_saving_flags(),\
> > .last_balance = jiffies, \
> > .balance_interval = 1, \
> > diff --git a/include/linux/sched.h b/include/linux/sched.h
> > index 5755643..c53bdd8 100644
> > --- a/include/linux/sched.h
> > +++ b/include/linux/sched.h
> > @@ -844,9 +844,18 @@ static inline int sd_balance_for_mc_power(void)
> > return 0;
> > }
> >
> > +static inline int sd_balance_for_mn_power(void)
> > +{
> > + if (sched_mc_power_savings || sched_smt_power_savings)
> > + return SD_POWERSAVINGS_BALANCE;
> > +
> > + return 0;
> > +}
> > +
> > static inline int sd_balance_for_package_power(void)
> > {
> > - if (sched_mc_power_savings | sched_smt_power_savings)
> > + if (sched_mn_power_savings || sched_mc_power_savings ||
> > + sched_smt_power_savings)
> > return SD_POWERSAVINGS_BALANCE;
> >
> > return 0;
> > @@ -860,7 +869,8 @@ static inline int sd_balance_for_package_power(void)
> >
> > static inline int sd_power_saving_flags(void)
> > {
> > - if (sched_mc_power_savings | sched_smt_power_savings)
> > + if (sched_mn_power_savings || sched_mc_power_savings ||
> > + sched_smt_power_savings)
> > return SD_BALANCE_NEWIDLE;
> >
> > return 0;
--
Thanks and Regards
gautham
next prev parent reply other threads:[~2009-08-25 9:34 UTC|newest]
Thread overview: 64+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-20 13:12 [RFC][PATCH 0/15] sched: Fix scheduling for multi-node processors Andreas Herrmann
2009-08-20 13:15 ` [PATCH 1/15] x86, sched: Add config option for multi-node CPU scheduling Andreas Herrmann
2009-08-21 13:50 ` Valdis.Kletnieks
2009-08-24 8:49 ` Andreas Herrmann
2009-08-20 13:34 ` [PATCH 2/15] sched, x86: Provide initializer for MN scheduling domain, define MN level Andreas Herrmann
2009-08-20 13:34 ` [PATCH 3/15] sched: Add cpumask to be used when building MN domain Andreas Herrmann
2009-08-20 13:35 ` [PATCH 4/15] sched: Define per CPU variables and cpu_to_group function for " Andreas Herrmann
2009-08-20 13:36 ` [PATCH 5/15] sched: Add function to build MN sched domain Andreas Herrmann
2009-08-20 13:37 ` [PATCH 6/15] sched: Add support for MN domain in build_sched_groups Andreas Herrmann
2009-08-20 13:38 ` [PATCH 7/15] sched: Activate build of MN domains Andreas Herrmann
2009-08-20 13:39 ` [PATCH 8/15] sched: Add parameter sched_mn_power_savings to control MN domain sched policy Andreas Herrmann
2009-08-24 14:56 ` Peter Zijlstra
2009-08-24 15:32 ` Vaidyanathan Srinivasan
2009-08-24 15:45 ` Peter Zijlstra
2009-08-25 7:52 ` Andreas Herrmann
2009-08-25 7:50 ` Andreas Herrmann
2009-08-25 6:24 ` Andreas Herrmann
2009-08-25 6:41 ` Peter Zijlstra
2009-08-25 8:38 ` Andreas Herrmann
2009-08-26 9:30 ` Gautham R Shenoy
2009-08-27 12:47 ` Andreas Herrmann
2009-08-20 13:40 ` [PATCH 9/15] sched: Check sched_mn_power_savings when setting flags for CPU and MN domains Andreas Herrmann
2009-08-24 14:57 ` Peter Zijlstra
2009-08-25 9:34 ` Gautham R Shenoy [this message]
2009-08-26 10:01 ` Gautham R Shenoy
2009-08-20 13:41 ` [PATCH 10/15] sched: Check for sched_mn_power_savings when doing load balancing Andreas Herrmann
2009-08-24 15:03 ` Peter Zijlstra
2009-08-24 15:40 ` Vaidyanathan Srinivasan
2009-08-25 8:00 ` Andreas Herrmann
2009-08-20 13:41 ` [PATCH 11/15] sched: Pass unlimited __cpu_power information to upper domain level groups Andreas Herrmann
2009-08-24 15:21 ` Peter Zijlstra
2009-08-24 16:44 ` Balbir Singh
2009-08-24 17:26 ` Peter Zijlstra
2009-08-24 18:19 ` Balbir Singh
2009-08-25 7:11 ` Peter Zijlstra
2009-08-25 8:04 ` Balbir Singh
2009-08-25 8:30 ` Peter Zijlstra
2009-08-25 8:51 ` Andreas Herrmann
2009-08-20 13:42 ` [PATCH 12/15] sched: Allow NODE domain to be parent of MC instead of CPU domain Andreas Herrmann
2009-08-24 15:32 ` Peter Zijlstra
2009-08-25 8:55 ` Andreas Herrmann
2009-08-20 13:43 ` [PATCH 13/15] sched: Detect child domain of NUMA (aka NODE) domain Andreas Herrmann
2009-08-24 15:34 ` Peter Zijlstra
2009-08-25 9:13 ` Andreas Herrmann
2009-08-20 13:45 ` [PATCH 14/15] sched: Conditionally limit __cpu_power when child sched domain has type NODE Andreas Herrmann
2009-08-24 15:35 ` Peter Zijlstra
2009-08-25 9:19 ` Andreas Herrmann
2009-08-20 13:46 ` [PATCH 15/15] x86: Fix cpu_coregroup_mask to return correct cpumask on multi-node processors Andreas Herrmann
2009-08-24 15:36 ` Peter Zijlstra
2009-08-24 18:21 ` Ingo Molnar
2009-08-25 10:13 ` Andreas Herrmann
2009-08-25 10:36 ` Ingo Molnar
2009-08-27 13:18 ` Andreas Herrmann
2009-08-25 9:31 ` Andreas Herrmann
2009-08-25 9:55 ` Peter Zijlstra
2009-08-25 10:20 ` Ingo Molnar
2009-08-25 10:24 ` Andreas Herrmann
2009-08-25 10:28 ` Ingo Molnar
2009-08-25 10:35 ` Peter Zijlstra
2009-08-27 15:42 ` Andreas Herrmann
2009-08-27 15:25 ` Andreas Herrmann
2009-08-28 10:39 ` Peter Zijlstra
2009-08-28 12:03 ` Andreas Herrmann
2009-08-28 12:50 ` Peter Zijlstra
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=20090825093442.GB4268@in.ibm.com \
--to=ego@in.ibm.com \
--cc=andreas.herrmann3@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=peterz@infradead.org \
/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®