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]
Date:	Tue, 12 Nov 2013 12:57:36 +0100
From:	Peter Zijlstra <peterz@...radead.org>
To:	Srikar Dronamraju <srikar@...ux.vnet.ibm.com>
Cc:	mingo@...nel.org, hpa@...or.com, linux-kernel@...r.kernel.org,
	tglx@...utronix.de, mikey@...ling.org,
	linux-tip-commits@...r.kernel.org
Subject: Re: [tip:sched/core] sched/fair: Fix group power_orig computation

On Tue, Nov 12, 2013 at 04:25:47PM +0530, Srikar Dronamraju wrote:
> From: Srikar Dronamraju <srikar@...ux.vnet.ibm.com>
> Date: Tue, 12 Nov 2013 03:05:31 -0500
> Subject: [PATCH] sched: Check sched_domain before computing group power.
> 
> After Commit-id 863bffc80898 (sched/fair: Fix group power_orig
> computation), we might end up computing group power before the
> sched_domain for a cpu is updated.
> 
> Check for rq->sd before updating group power.
> 
> Signed-off-by: Srikar Dronamraju <srikar@...ux.vnet.ibm.com>

Thanks! My head hurts a bit from going through the overlap init paths
but this does indeed revert to the previous behaviour.

I'm not entirely sure if either are fully correct, but given we
initialize the sgp->power to some 'reasonable' default we can rely on
runtime updates to correct any funnies.

> ---
>  kernel/sched/fair.c |    7 ++++++-
>  1 files changed, 6 insertions(+), 1 deletions(-)
> 
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index df77c60..f86f704 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -5354,8 +5354,13 @@ void update_group_power(struct sched_domain *sd, int cpu)
>  		 */
>  
>  		for_each_cpu(cpu, sched_group_cpus(sdg)) {
> -			struct sched_group *sg = cpu_rq(cpu)->sd->groups;
> +			struct rq *rq = cpu_rq(cpu);
> +			struct sched_group *sg;
>  
> +			if (!rq->sd)
> +				continue;
> +
> +			sg = rq->sd->groups;
>  			power_orig += sg->sgp->power_orig;
>  			power += sg->sgp->power;
>  		}
> -- 
> 1.7.1
> 
--
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