]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
cpuidle: governors: teo: Refine tick_intercepts vs total events check
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 14 Jan 2026 19:45:30 +0000 (20:45 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 23 Jan 2026 20:50:38 +0000 (21:50 +0100)
Use 2/3 as the proportion coefficient in the check comparing
cpu_data->tick_intercepts with cpu_data->total because it is close
enough to the current one (5/8) and it allows of more straightforward
interpretation (on average, intercepts within the tick period length
are twice as frequent as other events).

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Christian Loehle <christian.loehle@arm.com>
Link: https://patch.msgid.link/10793374.nUPlyArG6x@rafael.j.wysocki
drivers/cpuidle/governors/teo.c

index 5434584af040d12a91ab62eb3cb5d7f90de34b3d..750ab0678a772ca204fafcfb535d07d7f54fba37 100644 (file)
@@ -485,7 +485,7 @@ constraint:
         * total wakeup events, do not stop the tick.
         */
        if (drv->states[idx].target_residency_ns < TICK_NSEC &&
-           cpu_data->tick_intercepts > cpu_data->total / 2 + cpu_data->total / 8)
+           3 * cpu_data->tick_intercepts >= 2 * cpu_data->total)
                duration_ns = TICK_NSEC / 2;
 
 end: