[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHZ_5Ww2fMBGUR4gzNRZs-uV16j-hAevxT-vbNULRPsmKA7dow@mail.gmail.com>
Date: Wed, 29 May 2019 17:42:34 +0530
From: Gautham R Shenoy <ego.lkml@...il.com>
To: Abhishek Goel <huntbag@...ux.vnet.ibm.com>
Cc: trenn@...e.com, shuah@...nel.org,
Linux PM list <linux-pm@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] cpupower : frequency-set -r option misses the last cpu in
related cpu list
Hi Abhishek,
On Wed, May 29, 2019 at 3:02 PM Abhishek Goel
<huntbag@...ux.vnet.ibm.com> wrote:
>
> To set frequency on specific cpus using cpupower, following syntax can
> be used :
> cpupower -c #i frequency-set -f #f -r
>
> While setting frequency using cpupower frequency-set command, if we use
> '-r' option, it is expected to set frequency for all cpus related to
> cpu #i. But it is observed to be missing the last cpu in related cpu
> list. This patch fixes the problem.
>
> Signed-off-by: Abhishek Goel <huntbag@...ux.vnet.ibm.com>
> ---
> tools/power/cpupower/utils/cpufreq-set.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/tools/power/cpupower/utils/cpufreq-set.c b/tools/power/cpupower/utils/cpufreq-set.c
> index 1eef0aed6..08a405593 100644
> --- a/tools/power/cpupower/utils/cpufreq-set.c
> +++ b/tools/power/cpupower/utils/cpufreq-set.c
> @@ -306,6 +306,8 @@ int cmd_freq_set(int argc, char **argv)
> bitmask_setbit(cpus_chosen, cpus->cpu);
> cpus = cpus->next;
> }
> + /* Set the last cpu in related cpus list */
> + bitmask_setbit(cpus_chosen, cpus->cpu);
Perhaps you could convert the while() loop to a do .. while(). That
should will ensure
that we terminate the loop after setting the last valid CPU.
> cpufreq_put_related_cpus(cpus);
> }
> }
> --
> 2.17.1
>
--
Thanks and Regards
gautham.
Powered by blists - more mailing lists