* [PATCH] Documentation: admin-guide: pm: cpufreq: fix sampling_rate example command
@ 2026-06-21 2:25 wangxiaodong
2026-06-21 3:52 ` Randy Dunlap
0 siblings, 1 reply; 4+ messages in thread
From: wangxiaodong @ 2026-06-21 2:25 UTC (permalink / raw)
To: rafael, viresh.kumar
Cc: corbet, skhan, linux-pm, linux-doc, linux-kernel, wangxiaodong
The example shell command for setting ondemand's sampling_rate wraps an
arithmetic expansion $((...)) in command-substitution backticks. The
arithmetic result is then executed as a command, which fails and writes
an empty value. Drop the surrounding backticks so the computed value is
passed to echo as intended.
Signed-off-by: wangxiaodong <wangxiaodong827546786@gmail.com>
---
Documentation/admin-guide/pm/cpufreq.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Documentation/admin-guide/pm/cpufreq.rst b/Documentation/admin-guide/pm/cpufreq.rst
index 8831cface585..34baf20cc202 100644
--- a/Documentation/admin-guide/pm/cpufreq.rst
+++ b/Documentation/admin-guide/pm/cpufreq.rst
@@ -497,7 +497,7 @@ This governor exposes the following tunables:
represented by it to be 1.5 times as high as the transition latency
(the default)::
- # echo `$(($(cat cpuinfo_transition_latency) * 3 / 2))` > ondemand/sampling_rate
+ # echo $(($(cat cpuinfo_transition_latency) * 3 / 2)) > ondemand/sampling_rate
``up_threshold``
If the estimated CPU load is above this value (in percent), the governor
--
2.43.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Documentation: admin-guide: pm: cpufreq: fix sampling_rate example command
2026-06-21 2:25 [PATCH] Documentation: admin-guide: pm: cpufreq: fix sampling_rate example command wangxiaodong
@ 2026-06-21 3:52 ` Randy Dunlap
2026-06-21 5:57 ` Zhongqiu Han
0 siblings, 1 reply; 4+ messages in thread
From: Randy Dunlap @ 2026-06-21 3:52 UTC (permalink / raw)
To: wangxiaodong, rafael, viresh.kumar
Cc: corbet, skhan, linux-pm, linux-doc, linux-kernel
On 6/20/26 7:25 PM, wangxiaodong wrote:
> The example shell command for setting ondemand's sampling_rate wraps an
> arithmetic expansion $((...)) in command-substitution backticks. The
> arithmetic result is then executed as a command, which fails and writes
> an empty value. Drop the surrounding backticks so the computed value is
> passed to echo as intended.
>
> Signed-off-by: wangxiaodong <wangxiaodong827546786@gmail.com>
> ---
> Documentation/admin-guide/pm/cpufreq.rst | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/Documentation/admin-guide/pm/cpufreq.rst b/Documentation/admin-guide/pm/cpufreq.rst
> index 8831cface585..34baf20cc202 100644
> --- a/Documentation/admin-guide/pm/cpufreq.rst
> +++ b/Documentation/admin-guide/pm/cpufreq.rst
> @@ -497,7 +497,7 @@ This governor exposes the following tunables:
> represented by it to be 1.5 times as high as the transition latency
> (the default)::
>
> - # echo `$(($(cat cpuinfo_transition_latency) * 3 / 2))` > ondemand/sampling_rate
> + # echo $(($(cat cpuinfo_transition_latency) * 3 / 2)) > ondemand/sampling_rate
Ugh. Thanks.
Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
and possibly:
Fixes: e54ac586674d ("cpufreq: editing corrections to cpufreq.rst")
>
> ``up_threshold``
> If the estimated CPU load is above this value (in percent), the governor
--
~Randy
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Documentation: admin-guide: pm: cpufreq: fix sampling_rate example command
2026-06-21 3:52 ` Randy Dunlap
@ 2026-06-21 5:57 ` Zhongqiu Han
2026-07-06 18:51 ` Rafael J. Wysocki (Intel)
0 siblings, 1 reply; 4+ messages in thread
From: Zhongqiu Han @ 2026-06-21 5:57 UTC (permalink / raw)
To: Randy Dunlap, wangxiaodong, rafael, viresh.kumar
Cc: corbet, skhan, linux-pm, linux-doc, linux-kernel, zhongqiu.han
On 6/21/2026 11:52 AM, Randy Dunlap wrote:
>
>
> On 6/20/26 7:25 PM, wangxiaodong wrote:
>> The example shell command for setting ondemand's sampling_rate wraps an
>> arithmetic expansion $((...)) in command-substitution backticks. The
>> arithmetic result is then executed as a command, which fails and writes
>> an empty value. Drop the surrounding backticks so the computed value is
>> passed to echo as intended.
>>
>> Signed-off-by: wangxiaodong <wangxiaodong827546786@gmail.com>
>> ---
>> Documentation/admin-guide/pm/cpufreq.rst | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/Documentation/admin-guide/pm/cpufreq.rst b/Documentation/admin-guide/pm/cpufreq.rst
>> index 8831cface585..34baf20cc202 100644
>> --- a/Documentation/admin-guide/pm/cpufreq.rst
>> +++ b/Documentation/admin-guide/pm/cpufreq.rst
>> @@ -497,7 +497,7 @@ This governor exposes the following tunables:
>> represented by it to be 1.5 times as high as the transition latency
>> (the default)::
>>
>> - # echo `$(($(cat cpuinfo_transition_latency) * 3 / 2))` > ondemand/sampling_rate
>> + # echo $(($(cat cpuinfo_transition_latency) * 3 / 2)) > ondemand/sampling_rate
>
> Ugh. Thanks.
> Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
>
> and possibly:
> Fixes: e54ac586674d ("cpufreq: editing corrections to cpufreq.rst")
Thanks Randy,
Just to back up Randy's Fixes suggestion, the line evolved as follows
(most recent first):
2025/04/04 e54ac586674d: #echo `$((.. * 3 / 2))` > (trailing ` added)
2024/10/17 29dcbea92460: #echo `$((.. * 3 / 2)) > (still dangling `)
2017/03/13 2a0e49279850: #echo `$((.. * 750 / 1000)) > (dangling leading `)
The stray backtick can be traced back to 2a0e49279850, but it was just a
dangling backtick then. The closed command-substitution form fixed here
was only reached after e54ac586674d added the trailing backtick. Note
that the "750/1000 -> 3/2" change in 29dcbea92460 was not just a doc
edit: it reflects an actual change in the kernel's behaviour. So on the
older trees the underlying logic - and hence this documented example -
is genuinely different, and this patch wouldn't apply cleanly there
anyway. Pointing Fixes at 2a0e49279850 therefore wouldn't help
backports.
So using
Fixes: e54ac586674d ("cpufreq: editing corrections to cpufreq.rst")
seems reasonable.
Either way, the fix is fine to me:
Reviewed-by: Zhongqiu Han <zhongqiu.han@oss.qualcomm.com>
>
>>
>> ``up_threshold``
>> If the estimated CPU load is above this value (in percent), the governor
>
--
Thx and BRs,
Zhongqiu Han
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Documentation: admin-guide: pm: cpufreq: fix sampling_rate example command
2026-06-21 5:57 ` Zhongqiu Han
@ 2026-07-06 18:51 ` Rafael J. Wysocki (Intel)
0 siblings, 0 replies; 4+ messages in thread
From: Rafael J. Wysocki (Intel) @ 2026-07-06 18:51 UTC (permalink / raw)
To: Zhongqiu Han, wangxiaodong, Randy Dunlap
Cc: viresh.kumar, corbet, skhan, linux-pm, linux-doc, linux-kernel
On Sun, Jun 21, 2026 at 7:57 AM Zhongqiu Han
<zhongqiu.han@oss.qualcomm.com> wrote:
>
> On 6/21/2026 11:52 AM, Randy Dunlap wrote:
> >
> >
> > On 6/20/26 7:25 PM, wangxiaodong wrote:
> >> The example shell command for setting ondemand's sampling_rate wraps an
> >> arithmetic expansion $((...)) in command-substitution backticks. The
> >> arithmetic result is then executed as a command, which fails and writes
> >> an empty value. Drop the surrounding backticks so the computed value is
> >> passed to echo as intended.
> >>
> >> Signed-off-by: wangxiaodong <wangxiaodong827546786@gmail.com>
> >> ---
> >> Documentation/admin-guide/pm/cpufreq.rst | 2 +-
> >> 1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/Documentation/admin-guide/pm/cpufreq.rst b/Documentation/admin-guide/pm/cpufreq.rst
> >> index 8831cface585..34baf20cc202 100644
> >> --- a/Documentation/admin-guide/pm/cpufreq.rst
> >> +++ b/Documentation/admin-guide/pm/cpufreq.rst
> >> @@ -497,7 +497,7 @@ This governor exposes the following tunables:
> >> represented by it to be 1.5 times as high as the transition latency
> >> (the default)::
> >>
> >> - # echo `$(($(cat cpuinfo_transition_latency) * 3 / 2))` > ondemand/sampling_rate
> >> + # echo $(($(cat cpuinfo_transition_latency) * 3 / 2)) > ondemand/sampling_rate
> >
> > Ugh. Thanks.
> > Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
> >
> > and possibly:
> > Fixes: e54ac586674d ("cpufreq: editing corrections to cpufreq.rst")
>
>
> Thanks Randy,
>
> Just to back up Randy's Fixes suggestion, the line evolved as follows
> (most recent first):
>
> 2025/04/04 e54ac586674d: #echo `$((.. * 3 / 2))` > (trailing ` added)
> 2024/10/17 29dcbea92460: #echo `$((.. * 3 / 2)) > (still dangling `)
> 2017/03/13 2a0e49279850: #echo `$((.. * 750 / 1000)) > (dangling leading `)
>
> The stray backtick can be traced back to 2a0e49279850, but it was just a
> dangling backtick then. The closed command-substitution form fixed here
> was only reached after e54ac586674d added the trailing backtick. Note
> that the "750/1000 -> 3/2" change in 29dcbea92460 was not just a doc
> edit: it reflects an actual change in the kernel's behaviour. So on the
> older trees the underlying logic - and hence this documented example -
> is genuinely different, and this patch wouldn't apply cleanly there
> anyway. Pointing Fixes at 2a0e49279850 therefore wouldn't help
> backports.
>
> So using
>
> Fixes: e54ac586674d ("cpufreq: editing corrections to cpufreq.rst")
>
> seems reasonable.
>
> Either way, the fix is fine to me:
>
> Reviewed-by: Zhongqiu Han <zhongqiu.han@oss.qualcomm.com>
Applied as 7.3 material, thanks!
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-07-06 18:52 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-21 2:25 [PATCH] Documentation: admin-guide: pm: cpufreq: fix sampling_rate example command wangxiaodong
2026-06-21 3:52 ` Randy Dunlap
2026-06-21 5:57 ` Zhongqiu Han
2026-07-06 18:51 ` Rafael J. Wysocki (Intel)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®