Rafael J. Wysocki 42c4a7c2ef UPSTREAM: cpuidle: menu: Handle stopped tick more aggressively
Commit 87c9fe6ee495 (cpuidle: menu: Avoid selecting shallow states
with stopped tick) missed the case when the target residencies of
deep idle states of CPUs are above the tick boundary which may cause
the CPU to get stuck in a shallow idle state for a long time.

Say there are two CPU idle states available: one shallow, with the
target residency much below the tick boundary and one deep, with
the target residency significantly above the tick boundary.  In
that case, if the tick has been stopped already and the expected
next timer event is relatively far in the future, the governor will
assume the idle duration to be equal to TICK_USEC and it will select
the idle state for the CPU accordingly.  However, that will cause the
shallow state to be selected even though it would have been more
energy-efficient to select the deep one.

To address this issue, modify the governor to always use the time
till the closest timer event instead of the predicted idle duration
if the latter is less than the tick period length and the tick has
been stopped already.  Also make it extend the search for a matching
idle state if the tick is stopped to avoid settling on a shallow
state if deep states with target residencies above the tick period
length are available.

In addition, make it always indicate that the tick should be stopped
if it has been stopped already for consistency.

Fixes: 87c9fe6ee495 (cpuidle: menu: Avoid selecting shallow states with stopped tick)
Reported-by: Leo Yan <leo.yan@linaro.org>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: 4.17+ <stable@vger.kernel.org> # 4.17+
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
(cherry picked from commit 5ef499cd571c293b74a30d77e7ef512edb6ded6b)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ia2425eef223cd5028dc55ee6dc0aa7b45dd70e83
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-11-16 16:30:09 +01:00
2020-11-10 12:58:25 +01:00
2020-11-10 12:58:25 +01:00
2018-09-10 09:21:07 +02:00
2020-11-10 12:58:25 +01:00
2020-11-05 13:16:23 +01:00
2020-05-20 12:15:34 +02:00
2020-11-10 12:58:25 +01:00
2020-11-10 12:58:25 +01:00
2020-11-05 13:16:23 +01:00
2018-02-13 12:53:38 +01:00
2020-11-11 11:15:54 +01:00

Linux kernel
============

This file was moved to Documentation/admin-guide/README.rst

Please notice that there are several guides for kernel developers and users.
These guides can be rendered in a number of formats, like HTML and PDF.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.
See Documentation/00-INDEX for a list of what is contained in each file.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.
Description
No description provided
Readme 1.4 GiB
Languages
C 98.1%
Assembly 1.2%
Makefile 0.3%