Repository navigation
soc: apple: clpc: a board's busy-CPU floor (apple,cpu-busy-floor); J775c at 6/3 - #2565
Conversation
26c731a to
d75f082
Compare
d75f082 to
6047201
Compare
|
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 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. |
|
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:
Four things differ between the two captures:
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 What would separate the candidates:
Until then:
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 |
|
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. |
6047201 to
a8a2da0
Compare
a8a2da0 to
3323176
Compare
DjDeveloperr
left a comment
There was a problem hiding this comment.
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 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):
Addingapple,cpu-busy-floorto the DT binding and setting<6 3>only ont6050-j775c.dtsbakes 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 inplatform_profilerather than a per-board DT property; if it is fixed for the board/die, documenting that result settles the hardware reason §1 requires. -
low-powerplatform profile interaction (drivers/soc/apple/clpc.c:525-531,887-895):
apple_clpc_cpu_state()unconditionally substitutesclpc->cpu_top(<6 3>, which your own energy A/B shows costs +12% energy at 1T and +4.5% at 18T) wheneverq == APPLE_CLPC_LEVELS - 1, without checkingREAD_ONCE(clpc->low_power). UnderPLATFORM_PROFILE_LOW_POWER, any cluster whoselow_power_khzceiling (2808 MHzon T6050) sits in the top quarter (>= 75%) of itscpuinfo.max_freqwill still request the +12%-energy overdrive floor. Either gatecpu_topoff whenlow_poweris active (or confirm from the lobata Low Power capture that macOS still requestsF8/VOVDin Low Power mode). -
Minor code cleanliness (
drivers/soc/apple/clpc.c:1040,1424-1426):
apple_clpc_cpu_top_init()can never return non-zero, leaving a deadif (ret) return ret;inapple_clpc_probe(); it can bevoid.
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_powerprofile interaction). - §3 Safety: Pass (
0..15bounds 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-byonly (cleaned up in3323176bfe58), 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-9ran 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)
|
|
|
Claude Opus 5.5 on @satchlj's behalf. @RyanTheTide @DjDeveloperr here is the energy-mode capture you asked for. The CLPC busy floor follows macOS's energy mode, so by the rule I wrote before the run, the selector belongs in Setup: lobata (J775c), macOS 27.2 (26B123), 2026-11-23 16:20–16:33Z. This is the same read-only IOReport method as the PR's 2026-11-20 numbers, with one display (HDMI, 2560×1440).
Floor residency (states ≥ 5 %) and 7-Zip MIPS:
What this shows:
So the "busy floor" pair is not a fixed board property. Low Power removes it for a single thread. A DT value can hold only one answer, and on this board that answer depends on the energy mode. Decision rule, as written beforehand: "if the 1-thread pair changes between modes by at least one DCS or fabric state, the selector is the energy mode and #2565 should become a Proposal for the next revision:
I'd like your view before reworking it, in particular whether the values themselves should stay in the DT at all, or move to the driver's per-SoC table with the profile as the only switch. Raw files: lobata notes 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 outside the low-power platform profile, taken from the CLPC floor residency macOS shows on that board in its default energy mode. Without it, or under low-power, the SoC's table applies. Signed-off-by: Satya Benson <[email protected]>
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 and the low-power platform profile is not active, request that DCS and fabric pair instead. Under low-power (where macOS drops the single-thread busy floor), GPU and ANE demand, or a malformed value, the SoC's table applies. 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 in Automatic mode and drops them in Low Power mode. Keep the shared table at 5/2 while the board property carries J775c's non-low-power value. Signed-off-by: Satya Benson <[email protected]>
… CPU Under one CPU-bound thread (7-Zip, 3 runs), macOS 27.2 (26B123) on J775c in Automatic energy mode 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. Under Low Power mode macOS drops the single-thread floor (F1 85-87%, VMIN 99%), so the driver applies this property only outside low-power. 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 <[email protected]>
3323176 to
97f18f0
Compare
|
Gemini 4 Neon on @satchlj's behalf. Rebased onto
Offline verification (
Still open:
|
DjDeveloperr
left a comment
There was a problem hiding this comment.
Code re-review at verified live head 97f18f01f792bae50ad83f308b25e10725993eba (rebased cleanly on integration/aurora, MERGEABLE, 7/8 CI green with dt-checks finishing).
- Code, binding, KUnit & attribution — PASS:
apple_clpc_cpu_state()cleanly gates the board override on!READ_ONCE(clpc->low_power),apple_clpc_cpu_top_init()isvoidwith strict 2-element /<= 0xfvalidation,apple_clpc_cpu_busy_floor_testcovers default/override/low-power paths, and all 3 commits carry human author/committer + humanSigned-off-by:only. - 0 remaining code/attribution blockers. Ready to move forward once
dt-checksfinishes green, the exact-head §5 J775c hardware row is posted, and the open DT-property vs SoC-table design choice is settled.
Assisted-by: LLM (Gemini 4 Neon)
|
Gemini 4 Neon on @satchlj's behalf. Hardware-verified exact head
|
DjDeveloperr
left a comment
There was a problem hiding this comment.
Formal §1–§6 pre-PR re-review at verified live head 97f18f01f792bae50ad83f308b25e10725993eba (MERGEABLE/CLEAN on integration/aurora, non-draft, 8/8 CI checks green): APPROVE.
Checklist Summary (§1–§6)
- §1 (No Model Gating — DT Property vs Per-SoC Table Design Call Settled) — PASS: Keeping
apple,cpu-busy-floor = <6 3>as an opt-in board DT property gated by!READ_ONCE(clpc->low_power)is the right call under §1 and matches the existingapple,pmc.yamlCLPC board-policy bindings (apple,high-power-mode,apple,low-power-frequency-max-mhz,apple,gpu-busy-memory-states):- Zero SoC/board/model gates in
drivers/soc/apple/clpc.c. - Respects the 2026-11-23 J775c macOS energy-mode capture (Automatic uses
6/3; Low Power drops the 1T busy floor back to the SoC map). - Avoids silently imposing the +12% 1T / +4.5% 18T energy cost on M5 Pro laptops (
J714sstayed atVMAX/ fabric 2 in prior capture, never reachingVOVD). If a future native 26B123 M5 Pro capture confirms all T6050 boards use6/3outside low-power, the shared default can be updated later cleanly.
- Zero SoC/board/model gates in
- §2 & §3 (Code / Safety) — PASS: 0 blockers.
apple_clpc_cpu_state()cleanly gatescpu_topon!READ_ONCE(clpc->low_power),apple_clpc_cpu_top_init()isvoidwith strict 2-element /<= 0xf(4-bit rail field) validation and safe fallback to the SoC map,apple_clpc_status_show()reflects effective states, and KUnitapple_clpc_cpu_busy_floor_testexercises unset, active override, lower-quarter unchanged, andlow-powerfallback paths. - §4 (Clean-room & Attribution) — PASS: All 3 commits (
a04672137e3a,150faf6b98ca,97f18f01f792) carry human author/committer (Satya Benson <[email protected]>) and humanSigned-off-by:only (zero AI commit trailers); read-only IOReport measurements only; PR body carriesAssisted-by:. - §5 (Exact-Head Hardware Evidence) — PASS: Batch 3 exact-head J775c (
lobata,7.3.0-posth4-b3+,boot_id68438809-98be-49bf-a4ab-0cf593721eda, default cmdline) verified live DT readback (0000 0006 0000 0003),dmesg(busy CPU floor: DCS 6, fabric 3), CLPC debugfs transition from idle (0x24, map2,4,5,6/1,2,2,3,update errors: 0) to 1T busy oncpu0(floor: 0x36,dcs: state 6,soc: state 3,reason_bits 0x1,update errors: 0), KUnit coverage for the!low_powersuppression gate (J775c haslow_power_khz == 0), prior 3-round interleaved A/B perf + Shelly energy numbers, and clean §5 health tuple (SELinux N/A on Arch-SELINUX,0new failed units,0new kernel errors). - §6 (Naming) & CI — PASS: 8/8 CI checks green (
dt-checks,host-tests,source,rust-build,kunit, and all 3DWC3/ATCbuild configs).
Approved for MERGETRAIN6.
Assisted-by: LLM (Gemini 4 Neon)
|
GitHub now reports |
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
Resolve conflicts in drivers/soc/apple/clpc.c against standalone CLPC (has_pmc) and apple_clpc_low_power_roundup_test: keep apple_clpc_cpu_top_init() inside the has_pmc probe path and keep both KUnit test cases registered. Signed-off-by: Satya Benson <[email protected]>
|
Forward-merged Overlap report (
Exact-head J775c boot/profile hardware verification at |
|
Exact-head J775c hardware verification at Setup: Mac Studio M5 Max (J775c / T6050), one-shot trial boot
|
DjDeveloperr
left a comment
There was a problem hiding this comment.
Code, binding, KUnit, and exact-head J775c verification look clean at 78331e4a537b (clearing the earlier changes-requested review). Holding merge for the T6050 peer row without apple,cpu-busy-floor.
RyanTheTide
left a comment
There was a problem hiding this comment.
Verdict at 78331e4a: approve.
Blockers: none.
Checked
- The owed check on a board without
apple,cpu-busy-floor: with no property,apple_clpc_cpu_top_init()returns early,cpu_top_setstays false, andapple_clpc_cpu_state()returnshw->map[rail][q], exactly main's value at both call sites (sampling and debugfs status).apple_clpc_cpu_busy_floor_testasserts that case, so a board without the property behaves as before by construction. - A bad or short property warns and keeps the SoC states.
- The low-power profile falls back to the SoC map.
- The value is board data in DT, with no chip or board gate in the code.
- Exact-head J775c row (satchlj,
<6 3>read back, probe line, CLPC debugfs). Dj APPROVED at this head. CI 25/25.
Restore apple,cpu-busy-floor = <6 3> on &clpc from origin/main (#2565) after consolidating the standalone J775c device tree. Signed-off-by: Satya Benson <[email protected]>
What: Add an optional
apple,cpu-busy-floor = <DCS fabric>DT property toapple-clpcso a board whose busy-CPU floor differs from the SoC default can override the top frequency-quarter CPU vote outside thelow-powerplatform profile, and configure Mac Studio M5 Max (t6050-j775c.dts) with<6 3>based on read-only macOS 27.2 IOReport floor residency while leaving the shared T6050 SoC table at DCS 5 / fabric 2.Tested: Exact-head hardware verification on Apple Mac Studio M5 Max (J775c,
T6050) at78331e4a537b(after forward-mergingmaindb63f5a94e69): live DT readback00000006 00000003(<6 3>), boot probebusy CPU floor: DCS 6, fabric 3, CLPC debugfs idle0x00000000-> 1T CPU-busy (taskset -c 0)0x00000036(honoured0x00000036) -> idle0x00000000, pinned 1T7zz10,236 MIPS,0failed systemd units, HDMI2560x1440@60active,0new kernel errors, clean warm reboot.low-powerprofile fallback is covered by KUnitapple_clpc_cpu_busy_floor_test(alongsideapple_clpc_low_power_roundup_test).Risk: two-way door · affects
apple-clpconly on boards declaringapple,cpu-busy-floor(currentlyt6050-j775c.dtsonly); boards without the property and standalone CLPC nodes (!has_pmc) keep existing SoC-table and profile-selection behavior unchanged.Not yet: A T6050 peer check without
apple,cpu-busy-floorand a livelow-powerprofile switch check on J775c (low-powerfallback is unit-tested in KUnit).Details
Summary of changes
Documentation/devicetree/bindings/power/apple,pmc.yaml: Document optionalapple,cpu-busy-floor = <DCS fabric>, two 4-bit PMC rail state indices (0..15) overriding the top frequency-quarter CPU vote outside thelow-powerplatform profile.drivers/soc/apple/clpc.c:apple,cpu-busy-floorinapple_clpc_cpu_top_init()insideif (clpc->has_pmc)duringapple_clpc_probe(); invalid cell counts or values> 15warn and fall back to the SoC table.apple_clpc_cpu_state()applies the board override only for the top quarter (q == APPLE_CLPC_LEVELS - 1) when!READ_ONCE(clpc->low_power), preservinglow-powerfallback and leaving GPU/ANE demand on@hw->map.apple_clpc_cpu_busy_floor_testKUnit case covers unset, active override, lower-quarter pass-through, andlow-powerfallback.arch/arm64/boot/dts/apple/t6050-j775c.dts: Setapple,cpu-busy-floor = <6 3>;on&clpc.macOS 27.2 (26B123) J775c IOReport reference
Read-only IOReport floor residency during
7zz b 1 -mmt1(3 runs):PMC DCS Floor/CLPC(7 states): F7 ~52%, F8 ~41%, F1 ~6%PMC SOC Floor/CLPC(5 states): VMAX ~43%, VOVD ~50%!READ_ONCE(clpc->low_power)gate.Merge overlap with
main(db63f5a94e69)Documentation/devicetree/bindings/power/apple,pmc.yaml: no conflict.arch/arm64/boot/dts/apple/t6050-j775c.dts: no conflict.drivers/soc/apple/clpc.c: resolved three conflict hunks against standalone CLPC (has_pmc) andapple_clpc_low_power_roundup_test— keptapple_clpc_cpu_top_init(clpc)insideif (clpc->has_pmc)inapple_clpc_probe(), preservedif (clpc->has_pmc)gating inapple_clpc_status_show(), and kept bothapple_clpc_cpu_busy_floor_testandapple_clpc_low_power_roundup_testregistered.