linux-loongson/drivers/cpuidle/governors
Rafael J. Wysocki fa3fa55de0 cpuidle: governors: menu: Avoid using invalid recent intervals data
Marc has reported that commit 85975daeaa ("cpuidle: menu: Avoid
discarding useful information") caused the number of wakeup interrupts
to increase on an idle system [1], which was not expected to happen
after merely allowing shallower idle states to be selected by the
governor in some cases.

However, on the system in question, all of the idle states deeper than
WFI are rejected by the driver due to a firmware issue [2].  This causes
the governor to only consider the recent interval duriation data
corresponding to attempts to enter WFI that are successful and the
recent invervals table is filled with values lower than the scheduler
tick period.  Consequently, the governor predicts an idle duration
below the scheduler tick period length and avoids stopping the tick
more often which leads to the observed symptom.

Address it by modifying the governor to update the recent intervals
table also when entering the previously selected idle state fails, so
it knows that the short idle intervals might have been the minority
had the selected idle states been actually entered every time.

Fixes: 85975daeaa ("cpuidle: menu: Avoid discarding useful information")
Link: https://lore.kernel.org/linux-pm/86o6sv6n94.wl-maz@kernel.org/ [1]
Link: https://lore.kernel.org/linux-pm/7ffcb716-9a1b-48c2-aaa4-469d0df7c792@arm.com/ [2]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Tested-by: Christian Loehle <christian.loehle@arm.com>
Tested-by: Marc Zyngier <maz@kernel.org>
Reviewed-by: Christian Loehle <christian.loehle@arm.com>
Link: https://patch.msgid.link/2793874.mvXUDI8C0e@rafael.j.wysocki
2025-08-11 21:46:14 +02:00
..
gov.h cpuidle: menu: Skip tick_nohz_get_sleep_length() call in some cases 2023-08-17 11:28:38 +02:00
haltpoll.c cpuidle: haltpoll: do not shrink guest poll_limit_ns below grow_start 2024-02-12 17:02:51 +01:00
ladder.c cpuidle: ladder: fix ladder_do_selection() kernel-doc 2024-05-07 13:54:58 +02:00
Makefile cpuidle: add haltpoll governor 2019-07-30 17:27:37 +02:00
menu.c cpuidle: governors: menu: Avoid using invalid recent intervals data 2025-08-11 21:46:14 +02:00
teo.c cpuidle: teo: Fix typos in two comments 2025-04-09 19:34:23 +02:00