lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <18117.1379028063@ale.ozlabs.ibm.com>
Date:	Fri, 13 Sep 2013 09:21:03 +1000
From:	Michael Neuling <mikey@...ling.org>
To:	mingo@...nel.org, hpa@...or.com, linux-kernel@...r.kernel.org,
	peterz@...radead.org, tglx@...utronix.de,
	tip-bot for Peter Zijlstra <tipbot@...or.com>
cc:	linux-tip-commits@...r.kernel.org
Subject: Re: [tip:sched/core] sched/fair: Fix group power_orig computation

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

> Commit-ID:  863bffc80898b8df295ebac111af2335ec05f85d
> Gitweb:     http://git.kernel.org/tip/863bffc80898b8df295ebac111af2335ec05f85d
> Author:     Peter Zijlstra <peterz@...radead.org>
> AuthorDate: Wed, 28 Aug 2013 11:44:39 +0200
> Committer:  Ingo Molnar <mingo@...nel.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@...ling.org>
> Signed-off-by: Peter Zijlstra <peterz@...radead.org>
> Link: http://lkml.kernel.org/n/tip-db2pe0vxwunv37plc7onnugj@git.kernel.org
> Signed-off-by: Ingo Molnar <mingo@...nel.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;
>  }
>  
>  /*
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ