sched/idle: Enter wfi state instead of polling during active migration

WFI's wakeup latency is low enough, use that instead of polling and
burning power.

Change-Id: Iee1c1cdf515224267925037a859c6a74fc61abb7
Signed-off-by: Kazuki H <kazukih0205@gmail.com>
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
This commit is contained in:
Kazuki H
2023-09-23 18:39:13 +09:00
committed by Pranav Vashi
parent 094310650c
commit 06e0bcff04
2 changed files with 5 additions and 5 deletions

View File

@@ -51,6 +51,7 @@
#elif defined(CONFIG_COMMON_CLK_MSM)
#include "../../drivers/clk/msm/clock.h"
#endif /* CONFIG_COMMON_CLK */
#include "../../kernel/sched/sched.h"
#define CREATE_TRACE_POINTS
#include <trace/events/trace_msm_low_power.h>
@@ -640,7 +641,8 @@ static int cpu_power_select(struct cpuidle_device *dev,
struct power_params *pwr_params;
uint64_t bias_time = 0;
if ((sleep_disabled && !cpu_isolated(dev->cpu)) || sleep_us < 0)
if ((sleep_disabled && !cpu_isolated(dev->cpu)) ||
is_reserved(dev->cpu) || sleep_us < 0)
return best_level;
idx_restrict = cpu->nlevels + 1;

View File

@@ -66,8 +66,7 @@ static noinline int __cpuidle cpu_idle_poll(void)
local_irq_enable();
stop_critical_timings();
while (!tif_need_resched() &&
(cpu_idle_force_poll || tick_check_broadcast_expired() ||
is_reserved(smp_processor_id())))
(cpu_idle_force_poll || tick_check_broadcast_expired()))
cpu_relax();
start_critical_timings();
trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, smp_processor_id());
@@ -263,8 +262,7 @@ static void do_idle(void)
* broadcast device expired for us, we don't want to go deep
* idle as we know that the IPI is going to arrive right away.
*/
if (cpu_idle_force_poll || tick_check_broadcast_expired() ||
is_reserved(smp_processor_id())) {
if (cpu_idle_force_poll || tick_check_broadcast_expired()) {
tick_nohz_idle_restart_tick();
cpu_idle_poll();
} else {