From dfc5d8197b1e2550462352c15afe4150aa53392a Mon Sep 17 00:00:00 2001 Message-Id: In-Reply-To: <0bd66eb88c950d172a7dcefc61cb2e89b89cacce.1507911922.git.Jim.Somerville@windriver.com> References: <0bd66eb88c950d172a7dcefc61cb2e89b89cacce.1507911922.git.Jim.Somerville@windriver.com> From: Alex Shi Date: Thu, 12 Jan 2017 21:27:02 +0800 Subject: [PATCH 19/26] cpuidle/menu: stop seeking deeper idle if current state is deep enough [ commit 8e37e1a2a3295f5d99e6dbe99eca24eca7a034ef from linux-stable ] 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 Signed-off-by: Alex Kozyrev Signed-off-by: Jim Somerville --- drivers/cpuidle/governors/menu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c index c99fee9..eb9fb0e 100644 --- a/drivers/cpuidle/governors/menu.c +++ b/drivers/cpuidle/governors/menu.c @@ -323,11 +323,11 @@ 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; if (s->exit_latency * multiplier > data->predicted_us) - continue; + break; data->last_state_idx = i; data->exit_us = s->exit_latency; -- 1.8.3.1