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:	Wed, 26 Aug 2009 15:31:18 +0530
From:	Gautham R Shenoy <ego@...ibm.com>
To:	Andreas Herrmann <andreas.herrmann3@....com>
Cc:	Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...e.hu>,
	linux-kernel@...r.kernel.org, Balbir Singh <balbir@...ibm.com>,
	Vaidyanathan Srinivasan <svaidy@...ux.vnet.ibm.com>
Subject: Re: [PATCH 9/15] sched: Check sched_mn_power_savings when setting
	flags for CPU and MN domains

On Thu, Aug 20, 2009 at 03:40:13PM +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").
> 
> Signed-off-by: Andreas Herrmann <andreas.herrmann3@....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;

This again implies that if SD_POWERSAVINGS_BALANCE is set at any level,
it must also be set at it's parent.

With this constraint, there can only be 4 combinations.
0) SD_POWERSAVINGS_BALANCE not set.
1) SD_POWERSAVINGS_BALANCE set at SD_LV_CPU.
2) SD_POWERSAVINGS_BALANCE set at SD_LV_MN and SD_LV_CPU
3) SD_POWERSAVINGS_BALANCE set at SD_LV_MC, SD_LV_MN and SD_LV_CPU.

If we could independently decide the aggressiveness of consolidation
(i.e, 1 or 2), We can do away with these multiple sysfs variables have
have a single tunable.

Does this make sense ?

> +
>  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;
> -- 
> 1.6.0.4
> 
> 
> 
> --
> 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/
> 

-- 
Thanks and Regards
gautham
--
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