lkml.org 
[lkml]   [2015]   [Jul]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] cpupower: Do not change the frequency of offline cpu
Hi Shilpa,

This looks good.

Reviewed-by: Gautham R. Shenoy <ego@linux.vnet.ibm.com>

On Wed, Jul 22, 2015 at 01:50:49PM +0530, Shilpasri G Bhat wrote:
> Check if the cpu is online before changing the frequency/governor of
> the cpu.
>
> Signed-off-by: Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com>
> ---
> tools/power/cpupower/utils/cpufreq-set.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/tools/power/cpupower/utils/cpufreq-set.c b/tools/power/cpupower/utils/cpufreq-set.c
> index f656e58..4e21357 100644
> --- a/tools/power/cpupower/utils/cpufreq-set.c
> +++ b/tools/power/cpupower/utils/cpufreq-set.c
> @@ -17,6 +17,7 @@
>
> #include "cpufreq.h"
> #include "helpers/helpers.h"
> +#include "helpers/sysfs.h"
>
> #define NORM_FREQ_LEN 32
>
> @@ -318,6 +319,9 @@ int cmd_freq_set(int argc, char **argv)
> cpufreq_cpu_exists(cpu))
> continue;
>
> + if (sysfs_is_cpu_online(cpu) != 1)
> + continue;
> +
> printf(_("Setting cpu: %d\n"), cpu);
> ret = do_one_cpu(cpu, &new_pol, freq, policychange);
> if (ret) {
> --
> 1.9.3
>



\
 
 \ /
  Last update: 2015-07-23 07:41    [W:0.083 / U:0.464 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site