Skip to content

T8132: add the CPU energy model (enables EAS on M4) - #524

Merged
RyanTheTide merged 1 commit into
aurora-silicon:integration/aurorafrom
erikwb:j713/t8132-energy-model
Oct 27, 2026
Merged

RyanTheTide merged 1 commit into
aurora-silicon:integration/aurorafrom
erikwb:j713/t8132-energy-model

Conversation

@erikwb

@erikwb erikwb commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

T8132 (M4) has no CPU energy model, so energy-aware scheduling stays off even though apple-soc-cpufreq already registers the model from the OPP table. This adds measured opp-microwatt values to every OPP of both clusters, like T8103/T600x, T8112 and T8140.

Method (J713, MacBook Air 13" M4)

Following the T8140 method: one busy core per cluster at each operating point, pinned with scaling_min/max_freq, read from the SMC core-rail power meters.

  • P cluster: PP0b with one busy core. Its voltage steps with the P-state (584 mV at 912 MHz) and no other rail rises with the load. Each value is the mean of three runs, all within 2%. The top states were measured from a die below 55 C.
  • E cluster: PPbb idle plus a sixth of the rise with all six cores busy, because PPbb does not register a single busy core. Below 1476 MHz it does not register six either. The 900 and 1080 MHz values use the measured rail voltage (584 and 609 mV) and the cluster's dynamic coefficient fitted over 1476-2892 MHz: 72 mW per GHz·V², within 6% at every measured point.
  • Turbo: 4416 and 4464 MHz were measured with boost enabled.

With one busy core, 4044 and 4104 MHz run no faster than 3984 MHz (same throughput on a fixed integer loop), and 3876 MHz draws more than 3936 MHz. The energy model marks these states inefficient, and cpufreq skips them.

Result

  • Both perf domains register (EM: created perf domain), and the scheduler starts EAS for the root domain: pd1:{ cpus=1-6 nr_pstate=8 } pd0:{ cpus=0,7-9 nr_pstate=20 }.
  • Same-boot A/B with kernel.sched_energy_aware 1 vs 0, on battery, display on:
    • Idle desktop: no difference.
    • Light load (4 threads, 1 ms work every 10 ms): within noise.
    • Medium load (4 threads, 3 ms work every 10 ms): with EAS the P cluster stays at 0% busy. Without it, the P cluster takes 3-9% of the work at 1.5-2.0 GHz. System power is 21, 44 and 57 mW lower in the three pairs.
  • checkpatch --strict is clean. CHECK_DTBS + W=1 for all six T8132 boards show no new warnings against integration/aurora.

This change was developed and tested by Claude (Anthropic), working with me on the J713.

Add opp-microwatt to every OPP of both T8132 (M4) CPU clusters, so the
OPP core registers an energy model and the scheduler can use energy-aware
placement. Without it, EAS stays off on T8132 even though the cpufreq
driver already registers the model from the OPP table.

The values were measured on a MacBook Air (J713) with the method used for
T8140: one busy core per cluster at each operating point, pinned with
scaling_min/max_freq, read from the SMC core-rail power meters.

- P cluster: PP0b with one busy core. The rail voltage steps with the
  P-state (584 mV at 912 MHz) and no other rail rises with the load. Each
  point is the mean of three runs (within 2%), with the top points
  measured from a die below 55 C.
- E cluster: PPbb idle plus a sixth of the rise with all six cores busy,
  as PPbb does not register a single busy core. Below 1476 MHz it does
  not register six either; the 900 and 1080 MHz values use the measured
  rail voltage and the cluster's dynamic coefficient fitted from
  1476-2892 MHz (72 mW per GHz V^2, within 6% at each measured point).
- 4416 and 4464 MHz are turbo states, measured with boost enabled.

With one busy core, 4044 and 4104 MHz run no faster than 3984 MHz, and
3876 MHz draws more than 3936 MHz. The energy model marks these states
inefficient and cpufreq skips them.

On J713 with this model, a medium background load (four threads at 30%
duty) stays on the E cluster with EAS, instead of reaching the P cluster
3-9% of the time without it, and uses 20-57 mW less system power.

Signed-off-by: Erik Bourget <[email protected]>
@RyanTheTide
RyanTheTide merged commit 99dac99 into aurora-silicon:integration/aurora Oct 27, 2026
erikwb pushed a commit to erikwb/linux that referenced this pull request Oct 28, 2026
Brings the J616s batch5 kernel (the tree running on the M4 Pro) up to the
current integration/aurora, which adds aurora-silicon#524 (J713 T8132 energy model), aurora-silicon#526
(the T6041 display fabric carry, whose peer allocation field group batch5
already has) and aurora-silicon#529 (J713 USB-C idle power).

Conflict resolution:
- selftests apple-dcp rate.py: keep batch5's version. Its fixtures follow
  aurora-silicon#451's desktop adaptive sync and the T6041 external EDID. The
  integration/aurora side only changed how the lookup_mode() definition is
  found; its line-start pattern also matches the indented
  "lookup_mode(dcp, ..." call that batch5's iomfb.c has before the
  definition, while batch5's 'bool lookup_mode(' marker finds the
  definition in either form.

aurora-silicon#529's ATC and dwc3 changes merge cleanly beside aurora-silicon#516's two-lane DP pin D.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
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