Re: [PATCH] sched/idle: Prevent stopping the tick when there is no cpuidle driver

From: Pierre Gondois
Date: Thu Dec 21 2023 - 10:23:55 EST


Hello Anna-Maria,

On 12/15/23 14:05, Anna-Maria Behnsen wrote:
When there is no cpuidle driver, the system tries to stop the tick even if
the system is fully loaded. But stopping the tick is not for free and it
decreases performance on a fully loaded system. As there is no (cpuidle)
framework which brings CPU in a power saving state when nothing needs to be
done, there is also no power saving benefit when stopping the tick.

Just in case is wasn't taken into consideration:
-
Stopping the tick isn't free on a busy system, but it should also cost
something to regularly handle ticks on each CPU of an idle system.

FWIU, disabling the ticks also allows to add a CPU to the 'nohz.idle_cpus_mask'
mask, which helps the idle load balancer picking an idle CPU to do load
balancing for all the idle CPUs (cf. kick_ilb()).

It seems better to do one periodic balancing for all the idle CPUs rather
than periodically waking-up all CPUs to try to balance.

-
I would have assumed that if the system was fully loaded, ticks would
not be stopped, or maybe I misunderstood the case.
I assume the wake-up latency would be improved if the tick doesn't
have to be re-setup again.

Regards,
Pierre


Therefore do not stop the tick when there is no cpuidle driver.

Signed-off-by: Anna-Maria Behnsen <anna-maria@xxxxxxxxxxxxx>
---
kernel/sched/idle.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/kernel/sched/idle.c b/kernel/sched/idle.c
index 565f8374ddbb..fd111686aaf3 100644
--- a/kernel/sched/idle.c
+++ b/kernel/sched/idle.c
@@ -165,8 +165,6 @@ static void cpuidle_idle_call(void)
*/
if (cpuidle_not_available(drv, dev)) {
- tick_nohz_idle_stop_tick();
-
default_idle_call();
goto exit_idle;
}