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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 13 Aug 2010 14:13:40 -0700
From:	Suresh Siddha <suresh.b.siddha@...el.com>
To:	Heiko Carstens <heiko.carstens@...ibm.com>
Cc:	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Mike Galbraith <efault@....de>, Ingo Molnar <mingo@...e.hu>,
	Andreas Herrmann <andreas.herrmann3@....com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Martin Schwidefsky <schwidefsky@...ibm.com>
Subject: Re: [PATCH/RFC 2/5] [PATCH] sched: pass sched_domain_level to
 sched_power_savings_store

On Thu, 2010-08-12 at 10:25 -0700, Heiko Carstens wrote:
> From: Heiko Carstens <heiko.carstens@...ibm.com>
> 
> Pass the corresponding sched domain level to sched_power_savings_store instead
> of a yes/no flag which indicates if the level is SMT or MC.
> This is needed to easily extend the function so it can be used for a third
> level.
> 
> Signed-off-by: Heiko Carstens <heiko.carstens@...ibm.com>

Acked-by: Suresh Siddha <suresh.b.siddha@...el.com>

> ---
> 
>  kernel/sched.c |   17 ++++++++++++-----
>  1 file changed, 12 insertions(+), 5 deletions(-)
> 
> diff -urpN linux-2.6/kernel/sched.c linux-2.6-patched/kernel/sched.c
> --- linux-2.6/kernel/sched.c	2010-08-11 13:47:22.000000000 +0200
> +++ linux-2.6-patched/kernel/sched.c	2010-08-11 13:47:22.000000000 +0200
> @@ -7380,7 +7380,8 @@ static void arch_reinit_sched_domains(vo
>  	put_online_cpus();
>  }
>  
> -static ssize_t sched_power_savings_store(const char *buf, size_t count, int smt)
> +static ssize_t sched_power_savings_store(const char *buf, size_t count,
> +					 enum sched_domain_level sd_level)
>  {
>  	unsigned int level = 0;
>  
> @@ -7397,10 +7398,16 @@ static ssize_t sched_power_savings_store
>  	if (level >= MAX_POWERSAVINGS_BALANCE_LEVELS)
>  		return -EINVAL;
>  
> -	if (smt)
> +	switch (sd_level) {
> +	case SD_LV_SIBLING:
>  		sched_smt_power_savings = level;
> -	else
> +		break;
> +	case SD_LV_MC:
>  		sched_mc_power_savings = level;
> +		break;
> +	default:
> +		break;
> +	}
>  
>  	arch_reinit_sched_domains();
>  
> @@ -7418,7 +7425,7 @@ static ssize_t sched_mc_power_savings_st
>  					    struct sysdev_class_attribute *attr,
>  					    const char *buf, size_t count)
>  {
> -	return sched_power_savings_store(buf, count, 0);
> +	return sched_power_savings_store(buf, count, SD_LV_MC);
>  }
>  static SYSDEV_CLASS_ATTR(sched_mc_power_savings, 0644,
>  			 sched_mc_power_savings_show,
> @@ -7436,7 +7443,7 @@ static ssize_t sched_smt_power_savings_s
>  					     struct sysdev_class_attribute *attr,
>  					     const char *buf, size_t count)
>  {
> -	return sched_power_savings_store(buf, count, 1);
> +	return sched_power_savings_store(buf, count, SD_LV_SIBLING);
>  }
>  static SYSDEV_CLASS_ATTR(sched_smt_power_savings, 0644,
>  		   sched_smt_power_savings_show,
> 

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