linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Neuling <mikey@neuling.org>
To: mingo@kernel.org, hpa@zytor.com, linux-kernel@vger.kernel.org,
	peterz@infradead.org, tglx@linutronix.de,
	tip-bot for Peter Zijlstra <tipbot@zytor.com>
Cc: linux-tip-commits@vger.kernel.org
Subject: Re: [tip:sched/core] sched/fair: Fix group power_orig computation
Date: Fri, 13 Sep 2013 09:21:03 +1000	[thread overview]
Message-ID: <18117.1379028063@ale.ozlabs.ibm.com> (raw)
In-Reply-To: <tip-db2pe0vxwunv37plc7onnugj@git.kernel.org>

tip-bot for Peter Zijlstra <tipbot@zytor.com> wrote:

> Commit-ID:  863bffc80898b8df295ebac111af2335ec05f85d
> Gitweb:     http://git.kernel.org/tip/863bffc80898b8df295ebac111af2335ec05f85d
> Author:     Peter Zijlstra <peterz@infradead.org>
> AuthorDate: Wed, 28 Aug 2013 11:44:39 +0200
> Committer:  Ingo Molnar <mingo@kernel.org>
> CommitDate: Thu, 12 Sep 2013 19:14:43 +0200
> 
> sched/fair: Fix group power_orig computation
> 
> When looking at the code I noticed we don't actually compute
> sgp->power_orig correctly for groups, fix that.
> 
> Currently the only consumer of that value is fix_small_capacity()
> which is only used on POWER7+ and that code excludes this case by
> being limited to SD_SHARE_CPUPOWER which is only ever set on the SMT
> domain which must be the lowest domain and this has singleton groups.
> 
> So nothing should be affected by this change.
> 
> Cc: Michael Neuling <mikey@neuling.org>
> Signed-off-by: Peter Zijlstra <peterz@infradead.org>
> Link: http://lkml.kernel.org/n/tip-db2pe0vxwunv37plc7onnugj@git.kernel.org
> Signed-off-by: Ingo Molnar <mingo@kernel.org>

FWIW, this doesn't seem to break POWER7.  

Thanks!
Mikey

> ---
>  kernel/sched/fair.c | 16 +++++++++++-----
>  1 file changed, 11 insertions(+), 5 deletions(-)
> 
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index f9f4385..baba313 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -4450,7 +4450,7 @@ void update_group_power(struct sched_domain *sd, int cpu)
>  {
>  	struct sched_domain *child = sd->child;
>  	struct sched_group *group, *sdg = sd->groups;
> -	unsigned long power;
> +	unsigned long power, power_orig;
>  	unsigned long interval;
>  
>  	interval = msecs_to_jiffies(sd->balance_interval);
> @@ -4462,7 +4462,7 @@ void update_group_power(struct sched_domain *sd, int cpu)
>  		return;
>  	}
>  
> -	power = 0;
> +	power_orig = power = 0;
>  
>  	if (child->flags & SD_OVERLAP) {
>  		/*
> @@ -4470,8 +4470,12 @@ void update_group_power(struct sched_domain *sd, int cpu)
>  		 * span the current group.
>  		 */
>  
> -		for_each_cpu(cpu, sched_group_cpus(sdg))
> -			power += power_of(cpu);
> +		for_each_cpu(cpu, sched_group_cpus(sdg)) {
> +			struct sched_group *sg = cpu_rq(cpu)->sd->groups;
> +
> +			power_orig += sg->sgp->power_orig;
> +			power += sg->sgp->power;
> +		}
>  	} else  {
>  		/*
>  		 * !SD_OVERLAP domains can assume that child groups
> @@ -4480,12 +4484,14 @@ void update_group_power(struct sched_domain *sd, int cpu)
>  
>  		group = child->groups;
>  		do {
> +			power_orig += group->sgp->power_orig;
>  			power += group->sgp->power;
>  			group = group->next;
>  		} while (group != child->groups);
>  	}
>  
> -	sdg->sgp->power_orig = sdg->sgp->power = power;
> +	sdg->sgp->power_orig = power_orig;
> +	sdg->sgp->power = power;
>  }
>  
>  /*
> 

  reply	other threads:[~2013-09-12 23:21 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-12 18:05 [tip:sched/core] sched/fair: Fix group power_orig computation tip-bot for Peter Zijlstra
2013-09-12 23:21 ` Michael Neuling [this message]
2013-11-12 10:55 ` Srikar Dronamraju
2013-11-12 11:57   ` Peter Zijlstra
2013-11-12 16:41     ` [PATCH v2] sched: Check sched_domain before computing group power Srikar Dronamraju
2013-11-12 17:03       ` Peter Zijlstra
2013-11-12 17:15         ` Srikar Dronamraju
2013-11-12 17:55           ` Peter Zijlstra
2013-11-13  5:55             ` Srikar Dronamraju
     [not found]       ` <CAM4v1pNMn=5oZDiX3fUp9uPkZTPJgk=vEKEjevzvpwn=PjTzXg@mail.gmail.com>
2013-11-13 11:23         ` Srikar Dronamraju
2013-11-14  6:06           ` Preeti U Murthy
2013-11-14  8:30             ` Peter Zijlstra
2013-11-14  9:12               ` Preeti U Murthy
2013-11-13 15:17       ` Peter Zijlstra
2013-11-14 10:50         ` Srikar Dronamraju
2013-11-14 11:15           ` Peter Zijlstra
2013-11-19 19:15         ` [tip:sched/urgent] " tip-bot for Srikar Dronamraju
2013-11-19 23:36           ` Yinghai Lu
2013-11-21 15:03             ` Peter Zijlstra
2013-11-21 17:22               ` Yinghai Lu
2013-11-21 22:03                 ` Yinghai Lu
2013-11-28  3:02                   ` David Rientjes
2013-11-28  7:07                     ` Yinghai Lu
2013-11-28  9:38                       ` Peter Zijlstra
2013-11-28 20:23                         ` Yinghai Lu
2013-12-06  6:24                       ` Yinghai Lu
2013-12-10 10:58                         ` Peter Zijlstra
2013-12-10 21:26                           ` Yinghai Lu
2013-11-22 12:07                 ` Peter Zijlstra
2013-11-23  5:00                   ` Yinghai Lu
2013-11-23 18:53                     ` Peter Zijlstra
2013-11-28  2:57           ` David Rientjes

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=18117.1379028063@ale.ozlabs.ibm.com \
    --to=mikey@neuling.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=tipbot@zytor.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;
as well as URLs for NNTP newsgroup(s).