linux-loongson/drivers/cpuidle
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
..
governors cpuidle: governors: menu: Avoid using invalid recent intervals data 2025-08-11 21:46:14 +02:00
coupled.c cpuidle: Avoid explicit cpumask allocation on stack 2024-04-24 21:23:49 +02:00
cpuidle-arm.c cpuidle: Init cpuidle only for present CPUs 2025-03-12 21:31:59 +01:00
cpuidle-at91.c treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_56.RULE (part 2) 2022-06-10 14:51:35 +02:00
cpuidle-big_little.c cpuidle: Init cpuidle only for present CPUs 2025-03-12 21:31:59 +01:00
cpuidle-calxeda.c
cpuidle-clps711x.c cpuidle: clps711x: convert to devm_platform_ioremap_resource() 2019-12-20 10:04:27 +01:00
cpuidle-cps.c
cpuidle-exynos.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
cpuidle-haltpoll.c cpuidle: haltpoll: add missing MODULE_DESCRIPTION() macro 2024-06-14 18:15:38 +02:00
cpuidle-kirkwood.c Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
cpuidle-mvebu-v7.c cpuidle: mvebu: Fix duplicate flags assignment 2023-01-18 12:03:54 +01:00
cpuidle-powernv.c powerpc/cpuidle: Set CPUIDLE_FLAG_POLLING for snooze state 2022-12-06 23:18:19 +11:00
cpuidle-psci-domain.c cpuidle: psci: Drop redundant sync_state support 2025-07-09 13:30:01 +02:00
cpuidle-psci.c cpuidle: psci: Fix cpuhotplug routine with PREEMPT_RT=y 2025-07-14 13:09:04 +02:00
cpuidle-psci.h cpuidle: psci: Correct the domain-idlestate statistics in debugfs 2025-04-23 10:08:34 +02:00
cpuidle-pseries.c powerpc/machdep: Drop include of dma-mapping.h 2024-10-29 23:01:05 +11:00
cpuidle-qcom-spm.c cpuidle: Init cpuidle only for present CPUs 2025-03-12 21:31:59 +01:00
cpuidle-riscv-sbi.c cpuidle: riscv-sbi: Drop redundant sync_state support 2025-07-09 13:30:06 +02:00
cpuidle-tegra.c cpuidle, arch: Mark all ct_cpuidle_enter() callers __cpuidle 2023-01-13 11:48:17 +01:00
cpuidle-ux500.c mfd/cpuidle: ux500: Rename driver symbol 2021-08-16 13:42:34 +01:00
cpuidle-zynq.c
cpuidle.c cpuidle: Do not return from cpuidle_play_dead() on callback failures 2024-11-19 21:46:51 +01:00
cpuidle.h cpuidle: move to use bus_get_dev_root() 2023-03-22 20:25:23 +01:00
driver.c cpuidle: Correct some typos in comments 2024-10-18 18:44:32 +02:00
dt_idle_genpd.c cpuidle: dt_idle_genpd: Simplify with scoped for each OF child loop 2024-08-20 11:30:39 +02:00
dt_idle_genpd.h cpuidle: dt_idle_genpd: Add helper function to remove genpd topology 2023-08-08 16:06:20 +02:00
dt_idle_states.c cpuidle: dt: fix opencoded for_each_cpu() in idle_state_valid() 2025-07-10 14:53:28 +02:00
dt_idle_states.h
governor.c cpuidle: Remove redundant check in cpuidle_switch_governor() 2022-09-03 20:14:51 +02:00
Kconfig cpuidle-haltpoll: select haltpoll governor 2023-01-13 20:50:46 +01:00
Kconfig.arm cpuidle: psci: Do not suspend topology CPUs on PREEMPT_RT 2023-02-13 17:15:42 +01:00
Kconfig.mips
Kconfig.powerpc
Kconfig.riscv cpuidle: Add RISC-V SBI CPU idle driver 2022-03-10 09:29:51 -08:00
Makefile tracing: Disable branch profiling in noinstr code 2025-03-22 09:49:26 +01:00
poll_state.c cpuidle: Use local_clock_noinstr() 2023-06-05 21:11:09 +02:00
sysfs.c cpuidle: move to use bus_get_dev_root() 2023-03-22 20:25:23 +01:00