]> git.baikalelectronics.ru Git - kernel.git/commit
cpuidle: menu: Fall back to polling if next timer event is near
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Sun, 20 Mar 2016 00:33:35 +0000 (01:33 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 21 Mar 2016 14:50:28 +0000 (15:50 +0100)
commit856387489036de6f7d8110d81a47fda703c92594
tree57ae8bbc8c73539174eb6f026e8592d9d31893df
parent5c94b2fc40cda4150fa3c84e7dd19f9e61daa3d5
cpuidle: menu: Fall back to polling if next timer event is near

Commit 4505382007c8 (cpuidle,menu: use interactivity_req to disable
polling) changed the behavior of the fallback state selection part
of menu_select() so it looks at interactivity_req instead of
data->next_timer_us when it makes its decision.  That effectively
caused polling to be used more often as fallback idle which led to
significant increases of energy consumption in some cases.

Commit 5c94b2fc40cd (cpuidle: menu: use high confidence factors
only when considering polling) changed that logic again to be more
predictable, but that didn't help with the increased energy
consumption problem.

For this reason, go back to making decisions on which state to fall
back to based on data->next_timer_us which is the time we know for
sure something will happen rather than a prediction (which may be
inaccurate and turns out to be so often enough to be problematic).
However, take the target residency of the first proper idle state
(C1) into account, so that state is not used as the fallback one
if its target residency is greater than data->next_timer_us.

Fixes: 4505382007c8 (cpuidle,menu: use interactivity_req to disable polling)
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reported-and-tested-by: Doug Smythies <dsmythies@telus.net>
drivers/cpuidle/governors/menu.c