From: Alex Shi Date: Thu, 12 Jan 2017 13:27:02 +0000 (+0800) Subject: cpuidle/menu: stop seeking deeper idle if current state is deep enough X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8e37e1a2a3295f5d99e6dbe99eca24eca7a034ef;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git cpuidle/menu: stop seeking deeper idle if current state is deep enough Obsolete commit 71abbbf856a0 (cpuidle: extend cpuidle and menu governor to handle dynamic states) wanted to introduce dynamic C-states, but that idea was dropped long ago. The nonsense deeper C-state checking remained, though. Since both target_residency and exit_latency are longer for deeper idle state, there's no need to waste CPU time on useless checks. Signed-off-by: Alex Shi Acked-by: Rik van Riel [ rjw: Subject & changelog ] Signed-off-by: Rafael J. Wysocki --- diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c index d9b5b9398a0f..07e36bb54006 100644 --- a/drivers/cpuidle/governors/menu.c +++ b/drivers/cpuidle/governors/menu.c @@ -357,9 +357,9 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev) if (s->disabled || su->disable) continue; if (s->target_residency > data->predicted_us) - continue; + break; if (s->exit_latency > latency_req) - continue; + break; data->last_state_idx = i; }