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: <1326103578.2442.50.camel@twins>
Date:	Mon, 09 Jan 2012 11:06:18 +0100
From:	Peter Zijlstra <a.p.zijlstra@...llo.nl>
To:	Youquan Song <youquan.song@...el.com>
Cc:	linux-kernel@...r.kernel.org, mingo@...e.hu, tglx@...utronix.de,
	hpa@...or.com, akpm@...ux-foundation.org, stable@...r.kernel.org,
	suresh.b.siddha@...el.com, arjan@...ux.intel.com,
	len.brown@...el.com, anhua.xu@...el.com, chaohong.guo@...el.com,
	Youquan Song <youquan.song@...ux.intel.com>
Subject: Re: [PATCH] x86,sched: Fix sched_smt_power_savings totally broken

On Mon, 2012-01-09 at 16:56 +0800, Youquan Song wrote:
> sched_smt_power_savings is totally broken at lastest linux and -tip tree.

Yes it is.. also that knob should die! Like i've been saying for way too
long. I'm >< close to committing a patch removing all the power_saving
magic from the scheduler.

> sched_smt_power_savings is set to 1, the scheduler tries to schedule processes
>  on the least number of hyper-threads on a core as possible. In other words, 
> the process load is distributed such that all the hyper-threads in a core and 
> all the cores within the same processor are busy before the load is distributed
>  to other hyper-threads and cores in another processor. 

That's the most convoluted way I've seen that stated in a while. What
you're saying is that all threads (of a socket) should be used before
spilling over to another socket.

> This patch will set SMT sibling power capability to SCHED_POWER_SCALE
> (1024) when sched_smt_power_savings set. So when there is possible do power
> saving during scheduling, scheduler will truly schedule processes as
> sched_smt_power_savings should do.
>  
> 
> Signed-off-by: Youquan Song <youquan.song@...el.com>
> Tested-by: Anhua Xu <anhua.xu@...el.com>
> ---
>  kernel/sched/fair.c |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
> 
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index a4d2b7a..5be1d43 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -3715,6 +3715,9 @@ unsigned long default_scale_smt_power(struct sched_domain *sd, int cpu)
>  	unsigned long weight = sd->span_weight;
>  	unsigned long smt_gain = sd->smt_gain;
>  
> +	if (sched_smt_power_savings)
> +		return SCHED_POWER_SCALE;
> +
>  	smt_gain /= weight;
>  
>  	return smt_gain;

Hell no, that's completely the wrong thing to do. I think you want to
frob at the group_capacity computation in update_sg_lb_stats.

--
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