linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/4] Introduce Active Stats framework with CPU performance statistics
@ 2021-06-22  7:59 Lukasz Luba
  2021-06-22  7:59 ` [RFC PATCH 1/4] PM: Introduce Active Stats framework Lukasz Luba
                   ` (3 more replies)
  0 siblings, 4 replies; 21+ messages in thread
From: Lukasz Luba @ 2021-06-22  7:59 UTC (permalink / raw)
  To: linux-kernel, daniel.lezcano
  Cc: linux-pm, amitk, rui.zhang, lukasz.luba, dietmar.eggemann,
	Chris.Redpath, Beata.Michalska, viresh.kumar, rjw, amit.kachhap

Hi all,

This patch set introduces a new mechanism: Active Stats framework (ASF), which
gathers and maintains statistics of CPU performance - time residency at each
performance state.

The ASF tracks all the frequency transitions as well as CPU
idle entry/exit events for all CPUs. Based on that it accounts the active
(non-idle) residency time for each CPU at each frequency. This information can
be used by some other subsystems (like thermal governor) to enhance their
estimations about CPU usage at a given period.

Does it fix something in mainline?
Yes, there is thermal governor Intelligent Power Allocation (IPA), which
estimates the CPUs power used in the past. IPA is sampling the CPU utilization
and frequency and relies on the info available at the time of sampling
and this imposes the estimation errors.
The use of ASF solve the issue and enables IPA to make better estimates.

Why it couldn't be done using existing frameworks?
The CPUFreq and CPUIdle statistics are not combined, so it is not possible
to derive the information on how long exactly the CPU was running with a given
frequency. This new framework combines that information and provides
it in a handy way. IMHO it has to be implemented as a new framework, next to
CPUFreq and CPUIdle, due to a clean design and not just hooks from thermal
governor into the frequency change and idle code paths.

The patch set contains also a patch 4/4 which adds the new power model based
on ASF into the cpufreq cooling (used by thermal governor IPA).
It is added as ifdef option, since Active Stats might be not compiled in.
The ASF is a compile time option, but that might be changed and IPA could
select it, which would allow to remove some redundant code from
cpufreq_cooling.c.

Comments and suggestions are very welcome.

Regards,
Lukasz Luba

Lukasz Luba (4):
  PM: Introduce Active Stats framework
  cpuidle: Add Active Stats calls tracking idle entry/exit
  cpufreq: Add Active Stats calls tracking frequency changes
  thermal: cpufreq_cooling: Improve power estimation based on Active
    Stats framework

 Documentation/power/active_stats.rst | 128 +++++
 Documentation/power/index.rst        |   1 +
 MAINTAINERS                          |   8 +
 drivers/cpufreq/cpufreq.c            |   5 +
 drivers/cpuidle/cpuidle.c            |   5 +
 drivers/thermal/cpufreq_cooling.c    | 120 ++++-
 include/linux/active_stats.h         | 119 +++++
 kernel/power/Kconfig                 |   9 +
 kernel/power/Makefile                |   1 +
 kernel/power/active_stats.c          | 751 +++++++++++++++++++++++++++
 10 files changed, 1146 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/power/active_stats.rst
 create mode 100644 include/linux/active_stats.h
 create mode 100644 kernel/power/active_stats.c

-- 
2.17.1


^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2021-06-23  9:14 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-22  7:59 [RFC PATCH 0/4] Introduce Active Stats framework with CPU performance statistics Lukasz Luba
2021-06-22  7:59 ` [RFC PATCH 1/4] PM: Introduce Active Stats framework Lukasz Luba
2021-06-22  7:59 ` [RFC PATCH 2/4] cpuidle: Add Active Stats calls tracking idle entry/exit Lukasz Luba
2021-06-22 12:33   ` Rafael J. Wysocki
2021-06-22 13:58     ` Lukasz Luba
2021-06-22 14:44       ` Rafael J. Wysocki
2021-06-22 15:02         ` Lukasz Luba
2021-06-22  7:59 ` [RFC PATCH 3/4] cpufreq: Add Active Stats calls tracking frequency changes Lukasz Luba
2021-06-22  9:32   ` Viresh Kumar
2021-06-22 11:07     ` Lukasz Luba
2021-06-23  3:15       ` Viresh Kumar
2021-06-23  9:14         ` Lukasz Luba
2021-06-22 12:28   ` Rafael J. Wysocki
2021-06-22 13:42     ` Lukasz Luba
2021-06-22 13:51       ` Rafael J. Wysocki
2021-06-22 14:09         ` Lukasz Luba
2021-06-22 14:51           ` Rafael J. Wysocki
2021-06-22 14:59             ` Rafael J. Wysocki
2021-06-22 15:10               ` Lukasz Luba
2021-06-22 15:02             ` Lukasz Luba
2021-06-22  7:59 ` [RFC PATCH 4/4] thermal: cpufreq_cooling: Improve power estimation based on Active Stats framework Lukasz Luba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).