Commit 5510c5f
arch: arm64: configs: Remove CPUFreq times driver
Ignoring its colorful memory-leak-filled past, the CPUFreq times driver is
absolutely horrible for several reasons. Firstly, it allocs and reallocs
memory directly from the scheduler tick with IRQs disabled, which is not
only bad for latency, but also forbidden on RT. Secondly, the statistics
just aren't that useful because they're calculated using nonsense: a process
is assumed to have run at the same CPU freq for the entire jiffy (and that
freq is just the current freq at the time of the tick), the power consumed
for the entire jiffy is attributed to whatever unlucky process happens to
be running at the time of the scheduler tick, the UID owning the process is
blamed for other CPUs in the cluster not being idle (with no basis for it),
and there's assumed to be a strong correlation between a CPU's freq and the
power consumed by the process (when there isn't, at the very least because
all CPUs in a cluster share the same clock source, which means a high load
on any CPU in a cluster will cause all CPUs in the cluster to run at a higher freq).
Given that this driver's per-process power consumption statistics are
rooted in fantasy, remove it outright. There's really no way to accurately
blame processes for power consumption like this driver claims to without
adding overhead to every context switch and correlating a process' load
contribution with the selected CPU freq, which quickly becomes infeasible
given the overhead needed to perform these calculations at an acceptable
rate and precision. There's also no way to correlate the indirect ways
power may be consumed to the responsible process, such as with hardware
peripherals and most IRQs.
This is a slippery slope that'll never work, so remove the driver outright
and just have Android compute per-process power consumption linearly using
the amount of time each process runs on a CPU, which is provided by the
uid_sys_stats driver.
Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Change-Id: Ib6a32879b52d903a1a444e8d8005959ca3ea55be1 parent 317fd5f commit 5510c5f
1 file changed
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
91 | 90 | | |
92 | 91 | | |
93 | 92 | | |
| |||
0 commit comments