Skip to content

arm64: dts: apple: t6050: describe CPU OPP transition latency (stacked on #2302) - #2516

Open
satchlj wants to merge 1 commit into
sweep/cpufreq-lazyfrom
satchlj/cpufreq-t6050-transition-latency-20261120
Open

satchlj wants to merge 1 commit into
sweep/cpufreq-lazyfrom
satchlj/cpufreq-t6050-transition-latency-20261120

Conversation

@satchlj

@satchlj satchlj commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Stacked on #2302 for lazy cpufreq transition verification.

Set clock-latency-ns = <100000> on the T6050 M- and P-cluster CPU OPPs. The existing cpufreq OPP lookup reports 100,000 ns and sets schedutil's default rate_limit_us to 150 µs, down from the 6 ms derived from the timeout fallback.

Evidence

Earlier J775c userspace-governor tests timed transitions between the lowest or second-lowest OPP and the highest OPP on both M policies and the P policy. The largest end-to-end sysfs times were 60.0 µs for policy0, 102.5 µs for policy5, and 79.7 µs for policy10. The 100 µs value is nominal. The effect of this value on a workload still needs an isolated measurement.

Testing

  • ARM64 W=1 builds passed for apple/t6050-j775c.dtb and drivers/cpufreq/apple-soc-cpufreq.o. The compiled DTB contains 100,000 ns on all 37 CPU OPPs.
  • The revised head is untested on hardware. On J775c, verify per-policy latency and schedutil rate limits, repeat transition timing, and compare a latency-sensitive load at 6,000 vs. 150 µs on the same boot.

Assisted-by: LLM (OpenAI:GPT-6.2 Sol)

@RyanTheTide

Copy link
Copy Markdown
Contributor

Blockers: 2.

  1. drivers/cpufreq/apple-soc-cpufreq.c:221, :360, :1542-1543: this adds a per-SoC latency value, but the OPP table is already the place for it. dev_pm_opp_get_max_transition_latency() (:1541) returns the largest clock-latency-ns of the table's OPPs, and the T8103 tables already carry it (arch/arm64/boot/dts/apple/t8103.dtsi, clock-latency-ns on every OPP). The T6050 tables (arch/arm64/boot/dts/apple/t6050-base.dtsi:107 opp-table-mcluster, :177 opp-table-pcluster) have none, which is why the timeout fallback runs. Put the measured 100 us on the T6050 OPPs as clock-latency-ns = <100000> and drop the new transition_latency_us field and the info-> fallback. The driver needs no change, every SoC gets the same path, and the value can be set per cluster if the M and P clusters differ. If only one cluster was timed, say which, and measure the other before giving it the same value.
  2. Both commits in the stack carry Co-Authored-By: Claude Opus 5.5. Drop that trailer and keep only the human Signed-off-by. The PR body's last line should then be Assisted-by: LLM (<Vendor>:<Model>) and not "Generated with Claude Code".

HW row: J775c on this branch (with #2302) on the default command line. cpuinfo_transition_latency and scaling_governor schedutil rate_limit_us for each policy (expect 100000 ns and 150 us), and the userspace-governor transition timing repeated at this head on both clusters (p50/max under 100 us). Then a same-boot A/B of one latency-sensitive load with rate_limit_us at 6000 vs 150, plus 0 failed units, 0 AVC and 0 new kernel errors.

Assisted-by: LLM (Claude:Opus 5.5)

Set clock-latency-ns on the M- and P-cluster OPPs so cpufreq reads
the latency from the shared OPP tables. The nominal 100 us value
sets schedutil's default rate limit to 150 us on T6050.

Userspace-governor timing on J775c covered both M policies and the P
policy. For transitions between the lowest or second-lowest OPP and
the highest OPP, the maximum per policy was 60.0 us (policy0),
102.5 us (policy5), and 79.7 us (policy10). The timing is end to end
through sysfs. Repeat it with this change and check the rate limit
and workload response on the revised kernel.

Signed-off-by: Satya Benson <satya@benson.earth>
@satchlj
satchlj force-pushed the satchlj/cpufreq-t6050-transition-latency-20261120 branch from 450bfa5 to 5c4ee27 Compare November 21, 2026 12:33
@satchlj satchlj changed the title cpufreq: apple-soc: report T6050's measured transition latency (stacked on #2302) arm64: dts: apple: t6050: describe CPU OPP transition latency (stacked on #2302) Nov 21, 2026
@satchlj

satchlj commented Nov 21, 2026

Copy link
Copy Markdown
Member Author

Codex GPT-6.2 Sol on @satchlj's behalf

Moved the latency to clock-latency-ns on the M- and P-cluster OPPs. The revised PR has no cpufreq driver diff. The prior J775c run timed both M policies and the P policy. Their end-to-end maxima were 60.0, 102.5, and 79.7 µs, respectively, so 100 µs is a nominal setting.

Removed the co-author trailer from the DT commit and updated the PR footer. The current #2302 base (544c49819597) already carries only Ryan's human sign-off and was preserved.

The ARM64 J775c DTB and cpufreq object built with W=1. The revised head is untested on hardware. The per-policy readback, repeated timing, 6,000 vs. 150 µs workload A/B, and regression checks are pending.

@satchlj

satchlj commented Nov 21, 2026 •

Copy link
Copy Markdown
Member Author

Codex GPT-6.2 Sol on @satchlj's behalf

J775c one-shot on exact 5c4ee27a9439 over #2302 544c49819597. The bootable J775c carrier took all 37 OPP latency properties from the compiled PR tree, matched by frequency and level. No other carrier property changed. The trial config disabled PCI SDHCI, with the usual one-shot arm64.nomte and console flags.

All three policies came up with cpuinfo_transition_latency=100000 ns and schedutil rate_limit_us=150. End-to-end userspace-governor scaling_setspeed calls were timed over 200 transitions per direction, lowest and second-lowest to highest and back:

Policy Cluster Directional p50 range Maximum
policy0 M 12.0–60.6 µs 85.8 µs
policy6 M 61.0–71.1 µs 115.5 µs
policy12 P 60.8–75.1 µs 90.9 µs

All p50s were under 100 µs. Two of policy6's directional maxima exceeded 100 µs (103.3 and 115.5 µs).

Same-boot pp pipe 10 11 50000 on policy6, three invocations per rate and five internal passes each. Median round trip was 15.770 µs at 6000 µs (range 15.607–15.785) and 15.820 µs at 150 µs (15.810–15.838). No material win in this workload. All original 150 µs settings were restored before verified Aura handback.

0 AVC denials, 1 failed unit (ac-power-mode.service), and 3 boot error lines absent from Aura (Gen4 SPMI IRQ rejection and AOP probe), all also observed on the preceding #2518 trial using the same carrier. No cpufreq error was logged.

Timing and scope follow-up: 2,400 sysfs calls across three policies, two OPP pairs per policy, 200 calls per direction per pair. The largest observed end-to-end call was 115.5 µs (115,500 ns). A literal 100,000 ns bound does not cover these measurements. 120,000 ns would cover the captured sample only. These timings include sysfs overhead and do not establish a hardware-only bound or validate that rounded value under other loads.

The exact stack was integration ancestor 0abc2f385e54b8bf3226963e7f167eca5b68295f plus #2302 544c49819597 plus this head. The ancestor is 398 commits behind integration/aurora a84637dca209 as checked on Nov 21. Both layers merge cleanly in a changed-file text check against that tip; runtime on the merged tip is untested. Trial differences from installed Aura included the carrier DTB, PCI SDHCI off, arm64.nomte, console=tty0 and console=ttyDC0.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Re-review of 5c4ee27: Blockers: 1.

Points from the last review:

  1. Per-SoC driver latency field: resolved. The PR is now DT only. arch/arm64/boot/dts/apple/t6050-base.dtsi puts clock-latency-ns on all 37 M- and P-cluster OPPs (114-189 and in opp-table-pcluster from 193), the driver is unchanged, and the J775c row read back 100000 ns and rate_limit_us=150 on all three policies.
  2. Co-author trailer: resolved. 5c4ee27 carries only the human Signed-off-by, and the body ends with the Assisted-by: line.

New point:

  1. t6050-base.dtsi (every added clock-latency-ns = <100000>) and the commit message: clock-latency-ns is the worst-case transition latency, but your own runs exceed it. The earlier run had a policy5 maximum of 102.5 us, and this head's run had policy6 maxima of 103.3 and 115.5 us. The commit message calls 100 us "nominal" and still cites the earlier policy0/5/10 numbers, not the run on this head. Measure the transition without the sysfs path, from the cpu_frequency tracepoint to the driver seeing the new P-state, and put the measured bound per table (M and P can differ). Or use a value that covers the observed maximum, and say in the commit message how you derived it. Update the numbers in the message to the run on this head.

The same-boot pp pipe A/B (15.77 vs 15.82 us) shows no change, but that load holds the cluster at one clock, so the rate limit does not matter there. The benefit should show on a bursty load where schedutil has to ramp.

HW row: J775c, this branch (with #2302) on the current integration/aurora tip, default command line: per-policy cpuinfo_transition_latency and rate_limit_us at the final value, plus a same-boot A/B at the old 6000 us and the new rate limit on a ramp-sensitive load (schbench p99 wakeup latency, or a fixed-work bursty benchmark with its wall time), 0 AVC, 0 failed units, 0 new kernel errors.

Assisted-by: LLM (Claude:Opus 5.5)

@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.

Adversarial pre-PR checklist review (§1–§6) on 5c4ee27a9439054b812ac938f02b6b82f01181dc.

Blockers:

  1. §2 / DT binding violation — clock-latency-ns = <100000> under-reports your own measured maximum (arch/arm64/boot/dts/apple/t6050-base.dtsi:114-300):
    • Per Documentation/devicetree/bindings/opp/opp-v2-base.yaml:143-146, clock-latency-ns specifies "the maximum possible transition latency (in nanoseconds) for switching to this OPP from any other OPP", which drivers/cpufreq/apple-soc-cpufreq.c:1531-1539 reads via dev_pm_opp_get_max_transition_latency() for policy->cpuinfo.transition_latency.
    • Your own run on live head 5c4ee27a9439 measured policy6 (M cluster) directional maxima of 103.3 µs and 115.5 µs (and the earlier run hit 102.5 µs on policy5), both exceeding 100000 ns. Calling 100 µs "nominal" does not satisfy the binding. Either measure the in-kernel transition latency directly without sysfs overhead (e.g., from cpu_frequency / driver request to observed P-state completion, per cluster so M and P can carry distinct bounds if they differ), or set clock-latency-ns to a documented bound that covers the observed worst case.
  2. Stale commit message (5c4ee27a9439): Still cites the older policy0 (60.0 µs) / policy5 (102.5 µs) / policy10 (79.7 µs) numbers and ends with an open TODO ("Repeat it with this change and check the rate limit and workload response on the revised kernel"). Update it to match the final value, derivation, and live-head measurements.

Additional §2 / §5 / CI items to clear before approval:

  • §2 Default command line & current base: The J775c trial used a carrier DTB with PCI SDHCI disabled, non-default kernel parameters (arm64.nomte, console=tty0, console=ttyDC0), and an ancestor ~398+ commits behind integration/aurora (where t6050-base.dtsi has since changed), with 1 failed unit (ac-power-mode.service) and 3 boot error lines. Re-verify on current integration/aurora (with #2302) on the default command line with 0 AVC denials, 0 failed units, and 0 new kernel errors.
  • §5 Same-boot A/B: pp pipe showed no improvement (15.770 µs at 6000 µs vs 15.820 µs at 150 µs) because that load holds one clock; include a same-boot A/B on a ramp-sensitive/bursty load (e.g., schbench p99 wakeup latency or a bursty fixed-work test) comparing 6000 µs against the new rate_limit_us.
  • CI: No CI checks have run yet (stacked on sweep/cpufreq-lazy); ensure dt-checks passes once rebased/retargeted.

Checks passing:

  • §1 No model gating: Moving latency into the shared t6050-base.dtsi OPP tables with zero driver changes is the right approach.
  • §3 Safety: Thermal management properties are untouched.
  • §4 Clean-room & attribution: Commit 5c4ee27a9439 carries human author/committer and human Signed-off-by only (0 AI trailers); PR body includes Assisted-by:.
  • §6 Naming: Clean.

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