Skip to content

soc: apple: clpc: a board's busy-CPU floor (apple,cpu-busy-floor); J775c at 6/3 - #2565

Open
satchlj wants to merge 3 commits into
integration/aurorafrom
satchlj/j775c-clpc-cpu-floor-20261120
Open

satchlj wants to merge 3 commits into
integration/aurorafrom
satchlj/j775c-clpc-cpu-floor-20261120

Conversation

@satchlj

@satchlj satchlj commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Claude Opus 5.5 on @satchlj's behalf.

What this does: gives J775c (Mac Studio, M5 Max) the DCS/fabric pair a busy CPU cluster requests on this board, through a new CLPC property, apple,cpu-busy-floor. The pair is taken from the board's own macOS behaviour: its IOReport floor residency, recorded read-only. It is not taken from a list of tested boards, and T6050's shared table stays at DCS 5 / fabric 2.

  1. dt-bindings: apple,cpu-busy-floor = <DCS fabric>, two state indices, 0 for the lowest state, each 0–15 (a 4-bit PMC rail field).
  2. clpc: with the property, a cluster busy in the top quarter of its frequency range requests that pair instead of the top entry of the SoC's table.
    • There are no compatible or board checks.
    • Without the property, nothing changes.
    • An index above 15 or a wrong cell count is rejected with a warning, and the SoC's table is kept.
    • GPU and ANE demand keep the SoC's states.
  3. J775c DT: apple,cpu-busy-floor = <6 3>.

Base: integration/aurora f0c51766e9c5 (rebased 2026-11-20 14:4xZ; #2088, #2101 and #2447 since c92ed8517b79 touch none of this PR's files).

Where 6/3 comes from

macOS 27.2 (26B123) on lobata (J775c), recorded read-only with IOReport during 7zz b 1 -mmt1, 3 runs (behaviour only):

Floor Residency
PMC DCS Floor/CLPC (7 states) F7 ~52%, F8 ~41%, F1 ~6%
PMC SOC Floor/CLPC (5 states) VMAX ~43%, VOVD ~50%
  • A 0.5 s series shows the two floors moving together, as the pairs F7+VMAX and F8+VOVD, switching every second or so.
  • At idle both floors are in their lowest state 99.7% of the time.
  • The CPU-client SOC-DEV-DVFS floor channels (DCS/SOC Floor/PACC, MACC0, MACC1) read 0 throughout. macOS doesn't raise this floor through that path for a CPU-bound thread, which is why pmdomain: apple: pmp-report: DT-selected CPU memory floor, on by default for T6000 #2529's mechanism wasn't used here.

Mapping, not verified. Read in state order, F7+VMAX is DCS 5 / fabric 2 (the SoC table's top entry) and F8+VOVD is DCS 6 / fabric 3. That reading rests only on the order of the states:

  • DCS: macOS has 7 floor states and Linux has 7 DCS states.
  • Fabric: macOS has 5 SOC states, one of them (VOVD_TYP) never used. Linux has 4 fabric states.
  • The T6050 DT doesn't give these counts.

Static vs dynamic. macOS alternates between the two pairs within one run. A static floor can hold only one of them. This board asks for the top one, so it spends more time at 6/3 than macOS does.

Why a board property. J714sAP (M5 Pro) under macOS 26A428 differs: no vote for one CPU-bound thread, and DCS 5 / fabric 2 for 18 threads (b84f5655f2ee). Whether the macOS version or Pro vs Max causes the difference is open.

J714s capture (Dj's M5 Pro lane, 2026-11-20). It ran under macOS 26A428 in aura's hypervisor, not under 26B123 natively, so it is not conclusive between the OS version and Pro vs Max:

J714s, 26A428 DCS Floor/CLPC SOC Floor/CLPC
1T F8 54%, F7 41% VMAX 95%, VOVD 0%
18T F8 47%, F7 38% VMAX 85%, VOVD 0%

The CPU-client floors total 0 there too, as on J775c.

So the Pro reaches DCS F8 with SOC held at VMAX, and never reaches VOVD, the fabric state of the 6/3 pair. On J775c under 26B123 the two floors move together: F8 comes with VOVD, F7 with VMAX.

This is one more reason the shared T6050 default stays at 5/2. A 26B123 native capture on a Pro would separate the two causes. If it showed the 6/3 pair, the follow-up would change the shared default and this property would go away.

Testing (J775c, lobata)

A/B kernel: cand-6, 1487b5742831 = integration/aurora d91db387c720 + 81 composed commits + 2 local diagnostic commits (one makes the top map entry writable at run time). That is not this PR's head. Same boot, arms interleaved; median (range) over 3 rounds:

Arm (PMC floor read back) 5/2 (0x25, every round) 6/3 (0x36, every round)
7-Zip 1T on cpu0 9635 (9584–9648) 9884 (9883–9894)
7-Zip 18T 183857 (183753–185843) 189748 (187715–192740)
STREAM triad 18T (MB/s) 328493 (321023–333930) 361656 (360632–365305)
STREAM triad 1T (MB/s) 132306 (131183–132523) 131313 (130854–132691)
64 MiB latency, cpu0 (ns) 21.3 (21.1–21.4) 18.6 (18.1–18.8)
Idle wall power (Shelly, 20 steps) 8.959 W 8.954 W

6-thread STREAM is left out: its two ranges overlap widely between runs (166–265 vs 215–289 GB/s).

Energy to completion (cand-6 again, a second boot; Shelly wall energy, 2 interleaved rounds, no meter freeze; each run ±0.119 Wh of quantisation):

Fixed work 5/2 6/3 Difference
7-Zip 1T on cpu0, 60 passes 4.093, 4.121 Wh (936–938 s) 4.590, 4.611 Wh (901–905 s) +0.49 Wh (+12%) for 3.6% less time
7-Zip 18T, 20 passes 5.136, 5.143 Wh 5.363, 5.375 Wh +0.23 Wh (+4.5%) for 2% less time

So the higher floor costs energy under load, more than it saves in time: about 12% for one thread and 4.5% for 18. Idle doesn't change, because the floor drops at idle. Both differences are well outside the quantisation, and they repeat across rounds. That trade-off is why this is a board choice made from macOS's behaviour, not a default.

This PR's own code: cand-7, 324280cadc47 = d91db387c720 + 85, with these three commits (the DT hunk applied to #2102's J775c board file):

  • The kernel logs busy CPU floor: DCS 6, fabric 3.
  • Idle: floor 0x0.
  • 7-Zip 1T on cpu0, ×3: 0x36 (9949–9958).
  • GPU work (vkpeak): 0x26 (DCS 6 / fabric 2), the same as the tip's GPU floor.
  • T6050 has no ANE floor input on either kernel.

On this PR's base: cand-9, df1005dceaa0 = integration/aurora f0c51766e9c5 + 84, carrying these three commits. The kernel logs busy CPU floor: DCS 6, fabric 3. Under 7-Zip 1T on cpu0 the floor reads 0x36 (9864). Under GPU work it reads 0x26 (reason host_gpu), as on the tip. cand-8 (7b5df9391f5f on c92ed8517b79) read the same.

Static checks on this branch:

  • dt_binding_check for apple,pmc.yaml and CHECK_DTBS for t6050-j775c.dtb: no warnings.
  • clpc.o builds with W=1. Its one kernel-doc warning, about pmp_agent, comes from the tip's existing code.
  • Run on the branch at f44bf7af65ea. The rebases onto 391fac6343f5 and then c92ed8517b79 touched none of these files.

Untested:

  • other T6050 boards (none set the property, so their behaviour is unchanged by construction);
  • this exact branch head on hardware. cand-9 carries the same three commits on this base, with lobata's candidate composition (including arm64: dts: apple: support M5 Max Mac Studio (J775c) #2102's J775c DT, to which the DT hunk is applied).
  • workloads other than 7-Zip, STREAM and tinymembench.

Assisted-by: LLM (Anthropic:Claude Opus 5.5)

Let a board give the DCS and fabric state pair a CPU cluster busy in the
top quarter of its frequency range requests, taken from the CLPC floor
residency macOS shows on that board. Without it the SoC's table applies.

Signed-off-by: Satya Benson <satya@benson.earth>
A CPU cluster busy in the top quarter of its frequency range requests
the top entry of the SoC's map. Where the board's DT gives
apple,cpu-busy-floor, request that DCS and fabric pair instead. GPU and
ANE demand keep the SoC's states, and a malformed value keeps the SoC's
table.

T6050's table is shared by the M5 Pro and the M5 Max, and their macOS
behaviour differs: J714sAP (26A428) shows no vote for one CPU-bound
thread and DCS 5 / fabric 2 for 18 threads, while J775c (26B123) holds
its top two DCS/fabric floor pairs for one thread. Whether the macOS
version or the SoC variant causes this is not known, so the shared table
stays as it is and the board property carries J775c's value.

Signed-off-by: Satya Benson <satya@benson.earth>
… CPU

Under one CPU-bound thread (7-Zip, 3 runs), macOS 27.2 (26B123) on J775c
holds the CLPC's DCS floor at F7 for about 52% of the run and F8 for
about 41%, and its SOC floor at VMAX for about 43% and VOVD for about
50%. The two move together, as the pairs F7/VMAX and F8/VOVD. Read in
state order, those pairs are DCS 5 / fabric 2, the SoC table's top
entry, and DCS 6 / fabric 3. That reading is not verified: it rests on
the order of the states, 7 DCS floor states as Linux has 7 DCS states,
and 5 SOC states (one never used) where Linux has 4 fabric states. A
static floor can hold only one of the pairs; this board asks for the
top one.

Same-boot A/B, interleaved over 3 rounds; median (range):

  arm (PMC floor read back)  5/2 (0x25)              6/3 (0x36)
  7-Zip 1T on cpu0           9635 (9584-9648)        9884 (9883-9894)
  7-Zip 18T                  183857 (183753-185843)  189748 (187715-192740)
  STREAM triad 18T (MB/s)    328493 (321023-333930)  361656 (360632-365305)
  STREAM triad 1T (MB/s)     132306 (131183-132523)  131313 (130854-132691)
  64 MiB latency, cpu0 (ns)  21.3 (21.1-21.4)        18.6 (18.1-18.8)

Signed-off-by: Satya Benson <satya@benson.earth>
@satchlj
satchlj force-pushed the satchlj/j775c-clpc-cpu-floor-20261120 branch from d75f082 to 6047201 Compare November 20, 2026 14:42
@RyanTheTide

Copy link
Copy Markdown
Contributor

Thanks for the careful A/B and the energy numbers; they make the trade-off clear.

One question on where the choice lives. We select behaviour by a hardware property rather than by the machine it was measured on, and a board property is fine when it describes something about the board. Here t6050-j775c.dts:30-37 sets apple,cpu-busy-floor = <6 3> because macOS uses that pair on this board, while the description says the cause (macOS version, or Pro vs Max) is still open, and your rows show it is a performance/energy choice (+12% energy for 3.6% less time at 1T).

Could the binding and the J775c comment name the board difference that makes the higher floor right here, for example mains power and the Studio's cooling? Then the other desktops with that difference (J775d) would carry it too, and the laptops would not. If the 26B123 Pro capture shows it is the Max die instead, the value belongs at that level; if it is a preference, the "performance" platform profile is the natural selector.

The mechanism itself looks good to us.

@satchlj

satchlj commented Nov 20, 2026

Copy link
Copy Markdown
Member Author

Claude Opus 5.5 on @satchlj's behalf: thanks. The short answer is that the evidence doesn't yet name the board difference, so I'd rather not write one into the binding.

What we have:

Capture Board Die Chassis / power macOS How 1T floor pairs
lobata J775c Max desktop, mains 26B123 native F7+VMAX ~52%, F8+VOVD ~41%
Dj's lane J714s Pro laptop (power source not recorded) 26A428 aura hypervisor F8 54% / F7 41% with SOC VMAX 95%, VOVD 0%

Four things differ between the two captures:

  • the macOS version;
  • Max vs Pro;
  • desktop on mains vs laptop;
  • native vs hypervisor.

Any of them could be why the Pro never reaches VOVD, the fabric state of the 6/3 pair. Mains power and the Studio's cooling are a plausible reason, since VOVD reads as an overdrive state. But that's a hypothesis, and it is unproven that macOS keys the pair on the board's power or cooling.

On "a preference": macOS ran its default energy mode for that capture; nothing was set by hand. So 6/3 is what macOS does by default on this board, not a user preference in macOS's own terms. Matching macOS's default is why it sits in the balanced (default) path here, and not behind performance.

What would separate the candidates:

  1. Platform profile. I can repeat the read-only capture on lobata with macOS's energy mode set to Low Power, if the Studio offers one, and High Power, if it offers that. If the pair moves with the mode, the profile is the selector, as you suggest. That needs only lobata.
  2. Die vs chassis. A native 26B123 capture on a Max laptop (J714c or J716c), on AC and then on battery. 6/3 on AC would point at the die or the OS; 6/3 on AC only would point at power. The Pro capture under 26B123 that Dj's lane is looking at answers the OS-version part.

Until then:

  • The binding and the J775c comment stay worded as "this board's macOS residency", with the open cause stated.
  • I haven't added J775d. It's a two-die part with its own floor rails, and there's no J775d capture, so the value isn't known to carry over.

If a capture shows it's mains and cooling, I'll restate the property in those terms and add J775d. If it's the Max die, the value moves to the Max level. If it's the energy mode, it moves to the platform profile.

🤖 Generated with Claude Code

@RyanTheTide

Copy link
Copy Markdown
Contributor

Thanks, that is a fair answer, and the table makes the four confounders clear. Keeping the binding and the J775c comment worded as this board's measured macOS residency, with the cause stated as open, is fine for now. So is leaving J775d out until it has its own capture.

Your option 1 looks like the cheapest way to separate the candidates, since it needs only lobata. If the pair moves with macOS's energy mode, the selector is the platform profile and nothing per-board is needed. Could you run that capture before this lands? If the pair turns out to be fixed for the board, a short note on it in the description would settle it.

@satchlj

satchlj commented Nov 21, 2026

Copy link
Copy Markdown
Member Author

Claude Opus 5.5 on @satchlj's behalf: trailer-only rewrite, removed Co-Authored-By from 3 commit(s); same trees, Signed-off-by kept (6047201 -> a8a2da0, --force-with-lease).

@satchlj
satchlj force-pushed the satchlj/j775c-clpc-cpu-floor-20261120 branch from a8a2da0 to 3323176 Compare November 21, 2026 21:53
@satchlj

satchlj commented Nov 21, 2026

Copy link
Copy Markdown
Member Author

Claude Opus 5.5 on @satchlj's behalf: added the missing Signed-off-by: Satya Benson to 3 commit(s); same trees, nothing else changed (a8a2da0 -> 3323176, --force-with-lease).

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pre-PR checklist review at 3323176bfe58 (§1–§6). The DT property parsing (of_property_read_u32_array + > 0xf + of_property_count_u32_elems != APPLE_CLPC_RAILS), apple_clpc_status_show() update, commit attribution, and CI (8/8 green) are clean. Requesting changes on §1 design gating, a low-power profile interaction, and §5 evidence:

Blockers

  1. §1 No model gating — new per-board DT ABI before establishing the selector (Documentation/devicetree/bindings/power/apple,pmc.yaml, arch/arm64/boot/dts/apple/t6050-j775c.dts:30-37):
    Adding apple,cpu-busy-floor to the DT binding and setting <6 3> only on t6050-j775c.dts bakes a single-board override into the DT ABI while four confounders (macOS 26B123 vs 26A428, Max vs Pro, desktop/mains vs laptop, native vs hypervisor) remain unresolved and the state-order mapping is explicitly marked (state order, not verified). @RyanTheTide's open request from 2026-11-20 is still unanswered: please run the read-only macOS energy-mode capture (Low Power / Automatic / High Power) on lobata before landing. If the pair moves with macOS's energy mode, the selector belongs in platform_profile rather than a per-board DT property; if it is fixed for the board/die, documenting that result settles the hardware reason §1 requires.

  2. low-power platform profile interaction (drivers/soc/apple/clpc.c:525-531, 887-895):
    apple_clpc_cpu_state() unconditionally substitutes clpc->cpu_top (<6 3>, which your own energy A/B shows costs +12% energy at 1T and +4.5% at 18T) whenever q == APPLE_CLPC_LEVELS - 1, without checking READ_ONCE(clpc->low_power). Under PLATFORM_PROFILE_LOW_POWER, any cluster whose low_power_khz ceiling (2808 MHz on T6050) sits in the top quarter (>= 75%) of its cpuinfo.max_freq will still request the +12%-energy overdrive floor. Either gate cpu_top off when low_power is active (or confirm from the lobata Low Power capture that macOS still requests F8/VOVD in Low Power mode).

  3. Minor code cleanliness (drivers/soc/apple/clpc.c:1040, 1424-1426):
    apple_clpc_cpu_top_init() can never return non-zero, leaving a dead if (ret) return ret; in apple_clpc_probe(); it can be void.

Checklist summary (§1–§6)

  • §1 No model gating: Blocked by item 1 (unsettled board vs die vs platform-profile selector).
  • §2 Production-ready: Blocked by item 2 (low_power profile interaction).
  • §3 Safety: Pass (0..15 bounds check keeps 4-bit PMC rail fields intact; invalid DT falls back to SoC map).
  • §4 Clean-room & attribution: Pass — human commits and Signed-off-by only (cleaned up in 3323176bfe58), read-only IOReport measurements, Assisted-by: at end of PR body.
  • §5 Evidence: Incomplete — the PR body explicitly notes the exact branch head has not been booted on hardware (cand-9 ran against #2102's J775c DT composition), and no §5 regression run (0 SELinux denials, 0 failed units, 0 new kernel errors) is reported.
  • §6 Naming: Pass.

Assisted-by: LLM (Gemini 4 Neon)

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.

3 participants