Skip to content

arm64: dts: exynos: google: zumapro: Add the CPU energy model (Pixel 9a) - #300

Open
den-kloot wants to merge 1 commit into
derekross:omamobilefrom
den-kloot:zumapro-cpu-em
Open

den-kloot wants to merge 1 commit into
derekross:omamobilefrom
den-kloot:zumapro-cpu-em

Conversation

@den-kloot

Copy link
Copy Markdown
Contributor

The energy model from #280, alone, as you decided there on 2026-11-24: it can land on its own, and the C2 idle states wait for SLEEP-PLAN item 4 and a sleep series. #280 stays open for C2 (it'll be the C2 commit only once this is in).

One commit, bd47a6d50, a cherry-pick of #280's c9270eb16 onto today's omamobile (cf22a9090). It applied without conflicts, and the change is the same 39 lines in zumapro.dtsi. The message is the one you reviewed in #280, with the paragraph on the A520's inefficient OPPs.

Checks on this branch:

  • tools/kernel-pr-check -C <tree> origin/omamobile zumapro-cpu-em: every row ok (sign-off, no AI sign-off, subject prefix, checkpatch --strict 0/0/0, policy).
  • zumapro-tegu.dtb builds with W=1 and no dtc warnings.

What the measurements in the message cover: they come from the 9a's running kernel, which has both commits (7.3.0-rc6-omamobile-push1-gb54730e55758). I haven't booted this commit without C2. The energy model doesn't depend on the idle states: it is only opp-microwatt on the OPP tables, and the C2 commit only adds idle-states and cpu-idle-states. The time_in_state figures depend on schedutil and the inefficient-OPP marking, not on C2. If you want a boot of this exact commit on the 9a before merging, say so and I'll run it.

🤖 Generated with Claude Code

The zumapro CPU OPPs carry only opp-hz: ACPM sets the voltage, so there
is no opp-microvolt. The OPP core computes the energy model's power
from dynamic-power-coefficient and the voltage, gets nothing, and at
boot every CPU fails with "EM: invalid perf. state: -22". So there is no
energy-aware scheduling, and the power_allocator thermal governor
refuses to bind ("cpufreq-cpu7 is not a power actor").

As was done for zuma, give every OPP an opp-microwatt taken from
stock's pixel-em profile. The Pixel 9a is an A1 part in the IPOP
package (bootconfig hw.soc.rev=1, pkg_mode=1), so the values are the
"default" profile of Google's zumapro-a1-ipop.dts (kernel/devices/
google/zumapro, 8831630). That profile has no entries for the two
lowest cl0 OPPs, 324 and 610 MHz; those two are 820 MHz's power scaled
by frequency (14600 and 27500 uW), which can only underestimate them.

Measured on a Pixel 9a (2026-11-20/21): no "EM: invalid perf. state"
at boot, /sys/kernel/debug/energy_model lists cpu0, cpu4 and cpu7 with
these values, sched_energy_aware reads 1, and power_allocator now binds
to big-thermal (written to its policy and back to step_wise).

This changes the little cores' frequencies on every Pixel 9a. In
Google's profile the A520's power rises little from 820 to 1197 MHz, so
the energy model finds each cl0 OPP below 1197 MHz less efficient than
1197 MHz itself and marks it inefficient, and schedutil skips those
(324, 610, 820, 955 and 1098 MHz): the A520 cores run at 1197 MHz and
above. On a boot with this (1 h 28 min, screen on and off, schedutil,
scaling_min_freq 324000), cpu0's time_in_state is 0 at each of those
five and 3772 s at 1197 MHz. So the two estimated values above aren't
used in practice. The A720 and X4 clusters keep their lowest OPPs
(cpu4 spent most of that boot at 357 MHz, cpu7 at 700 MHz).

Assisted-by: LLM
Signed-off-by: kloot <1522975+den-kloot@users.noreply.github.com>

@derekross derekross left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @den-kloot, for splitting it out so quickly. This is the same commit as in #280 (same patch and message), with the paragraph on the A520's inefficient OPPs and your time_in_state behind it; I recomputed which OPPs the energy model drops from this table and get exactly the five you list. Our gate passes on today's omamobile.

I'd like to take you up on your offer of a boot of this exact commit, without C2. Your current figures were measured with C2 on, and the two pull in different directions here: without an idle state the cores wait in WFI, and this commit keeps the little ones at 1197 MHz or above, so the idle current could rise rather than fall. Could you post, from the published base plus this commit only, cpuidle/current_driver, cpu0's time_in_state, and the screen-off average current (Wi-Fi up, modem registered, as in your table) next to the same reading on today's kernel? If it turns out higher, that's still a decision I can make, but I'd like to know before it reaches every 9a.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants