Re: [PATCH v2] cpufreq: schedutil: Skip busy-CPU hold when NOHZ is inactive
From: Rafael J. Wysocki (Intel)
Date: Fri Nov 13 2026 - 14:14:21 EST
On Sun, Nov 8, 2026 at 3:50 PM Avi Weiss <thnkslprpt@xxxxxxxxx> wrote:
>
> sugov_hold_freq() uses the NOHZ idle-call counter to determine whether
> a CPU has been idle recently. When NOHZ is disabled or fails to
> activate, the counter does not advance, causing schedutil to treat
> the CPU as continuously busy and potentially prevent frequency
> reductions.
>
> Skip the busy-CPU hold when tick_nohz_is_active() is false. This
> also handles systems where NOHZ was enabled but never activated.
>
> Fixes: b7eaf1aab9f8 ("cpufreq: schedutil: Avoid reducing frequency of busy CPUs prematurely")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Avi Weiss <thnkslprpt@xxxxxxxxx>
I'd love to see some feedback on this from the people on the CC.
> ---
> v2:
> - use tick_nohz_is_active() instead of tick_nohz_enabled to also
> handle NOHZ enabled but never activated, as suggested by Zhan Xusheng
>
> kernel/sched/cpufreq_schedutil.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c
> index 14405a614991..50249cc1a594 100644
> --- a/kernel/sched/cpufreq_schedutil.c
> +++ b/kernel/sched/cpufreq_schedutil.c
> @@ -397,6 +397,9 @@ static bool sugov_hold_freq(struct sugov_cpu *sg_cpu)
> if (uclamp_rq_is_capped(cpu_rq(sg_cpu->cpu)))
> return false;
>
> + if (!tick_nohz_is_active())
> + return false;
> +
> /*
> * Maintain the frequency if the CPU has not been idle recently, as
> * reduction is likely to be premature.
>
> base-commit: fa4ad798f6f681031775266044ba1b0cf3c670bd
> --
> 2.43.0
>