Repository navigation
Conversation
zumapro.dtsi has no idle states, so on the Pixel 9a cpuidle has no driver (current_driver reads "none") and an idle core only ever waits in WFI. Add the C2 state of each core type as Google's zumapro-cpu.dtsi has it (android.googlesource.com kernel/devices/google/zumapro, 8831630): one "c2" state per cluster with PSCI suspend parameter 0x0010000 and stock's entry/exit latencies and minimum residencies, for the A520 (hayes), the A720 (hunter) and the X4 (hunterelp). Measured on a Pixel 9a with this on 7.3.0-rc6 (2026-11-20/21, menu governor): psci_idle registers WFI and c2 on all eight cores, and c2 is entered on every cluster. In a night with the screen off, Wi-Fi associated and the modem registered (suspend stays blocked with the modem up, so the phone is awake), the battery drew 464 mA on average (minimum 385 mA, 5 h, 5-minute samples), against 560 mA (never under 490 mA) in a comparable night without idle states; the cores were 93 % idle, 68 % of that in c2. A full discharge from 100 % to UPower's 2 % took 10 h 05 min with 31 min of screen-on time; the screen-off minutes averaged 481 mA. No hang or watchdog reset in the 15 h of that boot. zumapro has no mainline MCT (stock uses its own exynos-mct-v3 at 0x100d0000), so with local-timer-stop the tick of a core in c2 goes through the broadcast hrtimer, which keeps one core out of c2. Assisted-by: LLM Signed-off-by: kloot <1522975+den-kloot@users.noreply.github.com>
derekross
left a comment
There was a problem hiding this comment.
Thank you for this, and for doing it carefully. I checked both commits against Google's files at 8831630: the three idle states match zumapro-cpu.dtsi line for line, and 37 of the energy model's 39 values are exactly the "default" profile in zumapro-a1-ipop.dts, the other two being your estimates. Each commit builds without a dtc warning, and CI is green on today's branch.
The energy model first, because it's the easy one. With these numbers the kernel's energy model finds every little-core OPP below 1197 MHz less efficient than 1197 itself (Google's power barely rises from 820 to 1197 MHz), marks them inefficient, and schedutil then skips them, so the little cores run at 1197 MHz and above. That follows Google's data and is probably part of the saving you measured, but it is a real change for every 9a, so could you say it in the commit message, and post cpu0's cpufreq/stats/time_in_state from a boot with the commit? It also means the two estimated values don't matter in practice.
C2 is the part I need to think about. On the 9a, C2 during s2idle is one of the known causes of the silent no-wake, and what keeps it out of a sleep today is the device package's sleep hook (0.2.11 and later), which every logind sleep runs; a write to /sys/power/state or rtcwake -m mem doesn't. The 9a's sleep plan also left one question for exactly this moment: zuma's PMU data has no CPU hint handshake, which exynos-pmu.c describes as needed for CPU idle states on gs101, and the plan asked for that comparison before idle states came to a PR. I'll look at that and decide whether C2 goes in on this footing. Either way, before it merges I'd like one attended sleep run on this kernel: RTC-woken systemctl suspend sleeps with the modem off, on the charger, with the hook's /var/log/omamobile/cpuidle-sleep.log lines, each CPU's cpuidle/state1/time before and after each sleep (it should grow by far less than the sleep's length), and the wake source and length of each. Please also give the blob id of zumapro.dtsi in the kernel you ran, and what else that tree carries: the boot so far had no sleep in it.
If C2 takes longer, the energy model can land on its own once its message says what it does to the little cores; tell me if you'd like to split it.
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>
35b857a to
c9270eb
Compare
|
@derekross, the energy model part is in
The other clusters keep their lowest OPPs: cpu4 spent 366407 at 357 MHz, cpu7 248023 at 700 MHz. The kernel I ran.
I checked The attended sleep run isn't done yet. It needs the modem off for the boot, and that's the owner's call on this phone, so it'll come in a later comment with everything you listed: the hook's On splitting: either way is fine with me. If C2 needs the PMU hint question settled first, I'll split the energy model out as soon as you say so. Measured on my phone with Claude. |
|
Decision: the energy model can land on its own. The C2 idle states wait for SLEEP-PLAN item 4 (the CPU hotplug handshake) and a sleep series, because C2 entered through s2idle is a known cause of the 9a not waking and today only the sleep hook keeps it out. |
|
Following your decision, the energy model is now on its own in #300 (the same commit, rebased onto today's Posted from the owner's account by an AI coding agent (Claude Code), at the owner's request. |
derekross
left a comment
There was a problem hiding this comment.
Thanks, @den-kloot, for the split and the answers. Everything round 66 asked about the energy model is now in #300, and the tested tree's blob ids and contents are exactly what I needed. This one stays as decided: the C2 states wait for the CPU hotplug handshake question in the 9a's SLEEP-PLAN (item 4) and the attended sleep series. Once #300 is in, a plain rebase onto omamobile will drop the energy-model commit here by itself, since it's the same patch.
Two commits for zumapro (Pixel 9a). Both only touch
zumapro.dtsi.cpuidle/current_driverreadnoneand idle cores only ever sat in WFI. I took the per-clusterc2states (hayes, hunter and hunterelp) from Google'szumapro-cpu.dtsi.opp-microwatton all 39 CPU OPPs, from stock's pixel-em profile inzumapro-a1-ipop.dts("default"), the same way zuma got its model in 82f31d3. That fixesEM: invalid perf. state: -22at boot. It also lets EAS run andpower_allocatorbind, which came up in Pixel 9a: a full CPU load reaches the 105 °C critical trip in ~8 s and powers the phone off (big zone rises faster than step_wise throttles) omamobile#605. The two lowest cl0 OPPs (324 and 610 MHz) are missing from the profile. For those I scaled 820 MHz by frequency, which can only underestimate them.Tested on a Pixel 9a over a 15 h boot on 7.3.0-rc6 (
…-push1-g99b24b34811e), 2026-11-20/21. That kernel carries these samezumapro.dtsihunks; only my unrelated local commits differ. This branch is the same change rebased onto today'somamobile(82e3cf0), a clean apply.state1/usageis non-zero on cpu0, cpu4 and cpu7)./sys/kernel/debug/energy_modellists cpu0, cpu4 and cpu7, andsched_energy_awareis 1. Writingpower_allocatorto big-thermal'spolicynow works; before, it failed with "cpufreq-cpu7 is not a power actor". I set it back tostep_wise.cpuidle/state1/disable, came out −2.0 %, within its noise (mostly flash reads). I see no cost from c2.Not shown: zumapro has no mainline MCT, so a core in c2 gets its tick from the broadcast hrtimer, and one core stays out of c2 for that. This also doesn't show whether the s2idle watchdog problem in derekross/omamobile#765 goes away. I couldn't test a suspend, because the modem inhibitor blocks it.
Checks:
checkpatch.pl --strictreports 0/0/0 on both commits.make W=1 exynos/google/zumapro-tegu.dtb(LLVM) builds without warnings, and the built DTB has 8cpu-idle-statesand 39opp-microwatt.Measured on my phone with Claude.
🤖 Generated with Claude Code