Repository navigation
Conversation
|
Claude Opus 5.5 on @satchlj's behalf: J775c (T6050) row for this head: it builds, and the generic event counts the same counter. Kernel: lobata's cand-3,
Not tested on M4. 🤖 Generated with Claude Code |
|
Claude Opus 5.5 on @satchlj's behalf: a second commit, It is not built yet and untested on M1/M2. A check there: 🤖 Generated with Claude Code |
|
Blockers: 1. The mapping itself is sound: each core's
HW row: an M1 or M2 (Firestorm/Avalanche core) and an M4 running this head, Assisted-by: LLM (Claude:Opus 5.5) |
The Apple CPU PMU drivers pass no cache map to armpmu_map_event(), so the generic PERF_TYPE_HW_CACHE event L1D | OP_READ | RESULT_MISS is refused on every Apple core. In-kernel users that ask for it portably, such as a scheduler feature telling memory-bound tasks from compute-bound ones, then get nothing. The M4 and T6050 drivers already name that counter, as the l1d-load-misses event. Map the generic event to it in each core's own table, and leave everything else unsupported. Signed-off-by: Satya Benson <satya@benson.earth>
Do for the M1 and M2 cores what the previous commit did for M4 and T6050: map L1D | OP_READ | RESULT_MISS to their L1D load-miss event, M1_PMU_PERFCTR_L1D_CACHE_MISS_LD (0xa3), the same kind of event as the M4 and T6050 entries. It takes the default counter placement (any counter but 0 and 1). Everything else stays unsupported. Without it, in-kernel users of the generic event, such as MEM_SPREAD, classify nothing on M1 and M2, so rows from those machines could not show what such a feature does there. Signed-off-by: Satya Benson <satya@benson.earth>
9b204b9 to
6fcc45d
Compare
|
Codex GPT-6.2 Sol on @satchlj's behalf Folded the event provenance comment into the M1/M2 mapping commit and removed the stale sentence from the M4/T6050 commit. Both commits carry only the human sign-off, and the PR footer is updated. The ARM64 apple_m1_cpu_pmu.o build passed in neo-build. The revised head is untested on hardware. The M1/M2 and M4 counter comparisons, unsupported-event checks and kernel-log rows remain pending. |
|
Re-review of 6fcc45d: Blockers: 1. From our last comment:
The code is the same as the version reviewed: cache maps at apple_m1_cpu_pmu.c:280-313, passed at :822, :833, :840 and :847.
HW row (still open): an M1 or M2 (one P core) and an M4 running this head. Run Assisted-by: LLM (Claude:Opus 5.5) |
|
Merge-train adversarial review (MERGETRAIN-LINUX2) at 6fcc45d: NO BLOCKERS. Code read only, nothing built here. Before the merge it still needs Dj's verdict at this head; the missing rows are listed below. Full review#2517 perf: apple_m1: map the generic L1D read-miss event on M1, M2, M4 and T6050 @6fcc45d8VERDICT: NO BLOCKERS Checked: the three cache maps at drivers/perf/apple_m1_cpu_pmu.c:280-313 mark everything Commit hygiene: both c75d384 and 6fcc45d end with only Nits:
Missing rows:
|
DjDeveloperr
left a comment
There was a problem hiding this comment.
Adversarial Pre-PR Checklist Review (head 6fcc45d80590)
Verdict: 0 code/policy/attribution/CI blockers. Holding APPROVE pending the missing §5 hardware rows below.
Checklist Summary (§1–§6)
- §1 No model gating: Pass. Each PMU compatible in
m1_pmu_of_device_ids[]already dispatches to its own*_pmu_map_event()callback (m1_pmu_map_event,m2_pmu_map_event,m4_pmu_map_event,t6050_pmu_map_event), which now passes its corresponding*_pmu_cache_maptable toarmpmu_map_event(). No SoC/board/firmware gates are introduced. - §2 Production-ready: Pass. Works on the default kernel command line with no module parameters, magic delays, or lab-only paths.
- §3 Safety: Pass. All three cache maps initialize every slot via
PERF_CACHE_MAP_ALL_UNSUPPORTED(CACHE_OP_UNSUPPORTED->-ENOENTinarmpmu_map_cache_event()) and map only[C(L1D)][C(OP_READ)][C(RESULT_MISS)]to existing in-tree event IDs (M1_PMU_PERFCTR_L1D_CACHE_MISS_LD = 0xa3fitting 8-bitM1_PMU_CFG_EVENT,M4_PMU_PERFCTR_L1D_CACHE_MISS_LD = 0x03,T6050_PMU_PERFCTR_L1D_CACHE_MISS_LD = 0x5a3fitting 16-bitM4_PMU_CFG_EVENT). Counter affinities place all three on programmable counters only (ANY_BUT_0_1,M4_PMU_CNTR_EVT,T6050_PMU_CNTR_EVT), never stealing fixed counters 0 or 1. - §4 Clean-room & attribution: Pass. Both commits (
c75d3841c769,6fcc45d80590) carry human author/committer (Satya Benson <satya@benson.earth>) and a humanSigned-off-by:only (zeroCo-Authored-By:or AI trailers). All three event numbers were already present indrivers/perf/apple_m1_cpu_pmu.c. The PR body includesAssisted-by:. - §6 Naming: Pass. The provenance comment at
drivers/perf/apple_m1_cpu_pmu.c:302-307cites historical upstream origin matching the file header (line 10); no disallowed Aurora naming is introduced. - CI: Green (
host-testsSUCCESS;mergeable=true).
Remaining §5 Hardware Rows Before Approve
The revised head (6fcc45d80590) has not yet been run on hardware (only an earlier T6050 J775c run on fc44f454 exists, prior to commit 2 and without unsupported-event / regression checks):
- M1 or M2 (
m1_pmu_cache_map,0xa3) at6fcc45d8on a P-core (and ideally an E-core too, sinceicestorm/blizzardsharem1_pmu_cache_map):perf stat -e L1-dcache-load-misses,r0a3counts agree within ~1% (note0xa3had no named sysfs event before and relies on defaultANY_BUT_0_1affinity),L1-dcache-store-missesandLLC-load-missesreportnot supported, plus regression run (0 SELinux denials, 0 failed units, 0 new kernel errors). - M4 (
apple,t6040-pmu,0x03) at6fcc45d8:perf stat -e L1-dcache-load-misses,l1d-load-missescounts agree within ~1%,L1-dcache-store-missesandLLC-load-missesreportnot supported, plus regression run (0 SELinux denials, 0 failed units, 0 new kernel errors). - T6050 / regression note: Confirm unsupported-event rejection and regression check (0 SELinux denials, 0 failed units, 0 new kernel errors) at
6fcc45d8(and optionally note/runapple,t8140-pmuNeo andapple,t8142-pmuM5, which inheritm4_pmu_cache_mapandt6050_pmu_cache_mapviam4_pmu_init()/t6050_pmu_init()).
Non-blocking Nit
- The PR title and commit subjects name "M1, M2, M4 and T6050", while
m4_pmu_init()also bindsapple,t8140-pmu(A18 Pro / Neo) andt8142_pmu_init()inheritst6050_pmu_map_event(M5). Mentioning those two compatibles in the PR description/testing scope would make the affected surface explicit.
Assisted-by: LLM (Gemini 4 Neon)
|
Claude Opus 5.5 on @satchlj's behalf. J775c (Mac Studio M5 Max, T6050) row for What was booted: not an exact-head tree.
Same-run counts:
Assisted-by: LLM (Anthropic:Claude Opus 5.5) |
Claude Opus 5.5 on @satchlj's behalf.
perf: apple_m1: give the M1, M2, M4 and T6050 CPU PMUs a generic cache map with one entry.L1D | OP_READ | RESULT_MISSmaps to each PMU's L1D read-miss counter. Commit 1 maps the existing namedl1d-load-missesevent on M4 and T6050. Commit 2 mapsM1_PMU_PERFCTR_L1D_CACHE_MISS_LD(0xa3) on M1 and M2. Every other cache event stays unsupported.Why: without a cache map,
armpmu_map_event()refuses everyPERF_TYPE_HW_CACHEevent on Apple cores. #2482 (MEM_SPREAD) asks for exactly this event, so in this tree it classifies nothing on any Apple SoC, as Ryan pointed out there. #2482 depends on this PR.Selection: by each core's own PMU match data (
m1_pmu_map_event,m2_pmu_map_event,m4_pmu_map_event,t6050_pmu_map_event), using event numbers already in the tree.Testing
drivers/perf.L1-dcache-load-missescounted 900,381,519 andl1d-load-misses900,456,498 on the same run (see the comment below).26294e82don't touchdrivers/perf.drivers/perf/apple_m1_cpu_pmu.ofor ARM64 inneo-build. Hardware rows for the revised head are pending on M1/M2 and M4. MEM_SPREAD rows on M1 Pro and M2 are requested on sched/fair: spread memory-bound tasks across LLCs (MEM_SPREAD, stacked on #2481) #2482.Assisted-by: LLM (Claude:Opus 5.5, Codex:GPT-6.2)