]> git.baikalelectronics.ru Git - kernel.git/commit
cpuidle: menu: Avoid selecting shallow states with stopped tick
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 5 Apr 2018 17:12:43 +0000 (19:12 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 9 Apr 2018 09:54:57 +0000 (11:54 +0200)
commitab7da0cbca065a8e93d7d1a3c9c4abcd1ee904ff
treeb9a193663e33b6661ed06703b084a15ea71fdeb2
parentcff03e162920f7145e0206c5ee3b40d8c77f1dca
cpuidle: menu: Avoid selecting shallow states with stopped tick

If the scheduler tick has been stopped already and the governor
selects a shallow idle state, the CPU can spend a long time in that
state if the selection is based on an inaccurate prediction of idle
time.  That effect turns out to be relevant, so it needs to be
mitigated.

To that end, modify the menu governor to discard the result of the
idle time prediction if the tick is stopped and the predicted idle
time is less than the tick period length, unless the tick timer is
going to expire soon.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
drivers/cpuidle/governors/menu.c