Repository navigation
Conversation
|
Thanks for the STREAM work. The comparison with macOS is very useful. A few things before this can become a default:
|
|
Claude Opus 5.5 on @satchlj's behalf: thanks, you're right on all three.
I've updated the description with all of this. 🤖 Generated with Claude Code |
|
Claude Opus 5.5 on @satchlj's behalf: @RyanTheTide, taking you up on the offer of rows from your lab. MEM_SPREAD stays off by default until rows from other cores back a default. Lobata won't carry it on locally, so the J775c switch waits on these rows. What J775c shows
KernelThis PR's head (stacked on #2481 → #2480) plus #2517. #2517 maps the generic L1D read-miss event. Its first commit covers M4 and T6050, which includes your M4 Pro and A18 Pro ( Recipe (same boot, MEM_SPREAD off and on)
Then
The 500/250 thresholds were set on M5 Max cores, so the rows will also show whether they need to scale. 🤖 Generated with Claude Code |
|
Claude Opus 5.5 on @satchlj's behalf: ASYM_SPREAD is dropped in
Those paths are back as they were, except that misfit tracking still treats a memory-bound task as fitting when MEM_SPREAD is on. Tested: built and booted on J775c in lobata's cand-4. That is
Untested:
The lab rows requested above would cover the first and the last. 🤖 Generated with Claude Code |
|
Thanks for leaving MEM_SPREAD off by default and dropping ASYM_SPREAD, and for the detailed recipe. We will run it on our M1 Pro, M2, M4 Pro and A18 Pro on a kernel with this head and #2517 (including 9491b93), checking first that |
c0d8efc to
23e3003
Compare
e6103ff to
6c3280c
Compare
6c3280c to
a850edd
Compare
|
Claude Opus 5.5 on @satchlj's behalf. I rebased the branch onto its base #2481 (
Assisted-by: LLM (Anthropic:Claude Opus 5.5) |
|
Checked the rebase at a850edd. The six commits match 6c3280c: the added and removed lines are unchanged, and the only differences are context from #2481's One small thing for the history: ed77f7f turns MEM_SPREAD on and 9c77fe9 turns it back off. ed77f7f also carries the boot-time counter setup and the hotplug handling, and its message describes an on-by-default change. Folding 9c77fe9 into it, with the message adjusted, would leave a history that bisects to what actually merges. The M1 Pro, M2, M4 Pro and A18 Pro rows are still to come. They'll be on this head plus #2517 (including the M1/M2 map), in the off/on round format you listed. Assisted-by: LLM (Claude:Opus 5.5) |
a850edd to
f447dd1
Compare
|
Claude Opus 5.5 on @satchlj's behalf. @RyanTheTide I folded
Assisted-by: LLM (Anthropic:Claude Opus 5.5) |
There was a problem hiding this comment.
Formal Pre-PR Checklist Review (§1–§6) — REQUEST_CHANGES
Reviewed at verified live head f447dd13adcb25c52b07c6d08ba39c9a8d9d8a05 (satchlj/sched-mem-spread-20261119 → satchlj/sched-fork-exec-llc-20261119). Live CI: 0 check runs / 0 Actions workflow runs.
Blockers
- Stacked base & unmet functional dependencies (not mergeable to
integration/aurora):- Base branch is
satchlj/sched-fork-exec-llc-20261119(#2481, still OPEN), which is stacked on#2480(still OPEN). - Functionally depends on
#2517(still OPEN) to mapPERF_COUNT_HW_CACHE_L1D | OP_READ | RESULT_MISSon Apple CPU PMUs — without#2517,mem_spread_create_event()fails on every Apple SoC in this tree andMEM_SPREADclassifies nothing. - Also depends on the T6050 CPU cache DT (not yet landed) for LLC topology on T6050.
- Base branch is
- No live CI runs on
f447dd13adcb:- Because the PR targets a feature branch rather than
integration/aurora, zero GitHub Actions check runs have executed onf447dd13adcb.
- Because the PR targets a feature branch rather than
- §2 Production-ready & §1 No model gating — disabled by default with M5 Max-only magic thresholds:
SCHED_FEAT(MEM_SPREAD, false)(kernel/sched/features.h:118) leaves the feature off by default, requiring a manual debugfs write (echo MEM_SPREAD > /sys/kernel/debug/sched/features) to function — failing §2 ("Works on the default kernel command line: no new cmdline or module parameters, environment variables or manual steps needed for a feature to work").sysctl_mem_spread_high = 500,sysctl_mem_spread_low = 250, andsysctl_mem_spread_shift = 3(kernel/sched/fair.c:6373-6375) are hardcoded constants tuned from M5 Max cores alone rather than derived from hardware properties or backed by multi-generation SoC rows (M1/M2/M4/A18 Pro).
- §5 Evidence — unbooted at live head and unmeasured on this tree:
- All
MEM_SPREADSTREAM/7-Zip measurements in the PR body come from earlier private lobata kernels (2026-11-05/06) carrying a non-upstream PMU cache map. - Live head
f447dd13adcbhas not been booted or measured on hardware;MEM_SPREADenabled has never been tested after droppingASYM_SPREAD; the CPU hotplug path (mem_spread_cpu_online()/mem_spread_cpu_offline(), e.g. suspend/resume) has never been exercised on hardware; cross-SoC rows (M1 Pro, M2, M4 Pro, A18 Pro) with#2517are still pending; and no §5 regression tuple (0 SELinux denials,0 failed units,0 new kernel errors) has been posted forf447dd13adcb.
- All
- History & PR body hygiene:
- Commit
1b25b32292b0introducesASYM_SPREADonly for commitf447dd13adcbto remove it again, leaving dead add+remove churn in git history and a stray blank line atkernel/sched/sched.h:1038. Rebase outASYM_SPREADcleanly rather than landing an add+drop pair, and update the PR body (which still lists the pre-fold commits and saysASYM_SPREADwill be dropped in a follow-up).
- Commit
Non-blocking Nit
kernel/sched/fair.c:6582(sched_mem_spread_init()): unconditionally schedulesmem_spread_workat boot even whenMEM_SPREADandmem_spread_sampleare both off, causingmem_spread_update_events()to run an unnecessarysynchronize_rcu()on every boot. Guarding withif (mem_spread_wanted())avoids that boot-time no-op.
Pre-PR Checklist Summary (§1–§6)
- §1 No model gating: FAIL — thresholds (
500/250/shift=3) derived from M5 Max alone without multi-SoC validation or hardware-property scaling. - §2 Production-ready, no hacks: FAIL — off by default (requires manual debugfs toggle), add+drop
ASYM_SPREADhistory churn, unmet dependencies (#2480,#2481,#2517). - §3 Safety: PASS.
- §4 Clean-room & attribution: PASS — all 5 commits carry human author/committer (
Satya Benson) and humanSigned-off-by:only, zero AI trailers in commits. - §5 Evidence: FAIL — live head
f447dd13adcbunbooted, 0 CI runs,MEM_SPREADon & CPU hotplug untested at this head, missing cross-SoC A/B rows with#2517and §5 regression tuple. - §6 Naming: PASS.
23e3003 to
c412d8f
Compare
f447dd1 to
bc2c4ec
Compare
|
Gemini 4 Neon on @satchlj's behalf. Rebased cleanly onto updated
Stacked dependencies ( |
There was a problem hiding this comment.
Pre-PR re-review (§1–§6) at bc2c4ec92d72 (commits 76e1d85fe6a5, 3732ea280422, bc2c4ec92d72, stacked on #2481 c412d8fd1519): REQUEST_CHANGES — prior history/boot-nit items are cleared, but commit 76e1d85fe6a5 introduces a guaranteed 32-bit SMP build failure.
Prior Items Cleared
- Removed the intermediate
ASYM_SPREADadd+drop churn; history is now 3 clean commits. - Guarded
sched_mem_spread_update()insched_mem_spread_init()withif (mem_spread_wanted()), avoiding an unnecessary boot-timesynchronize_rcu(). - Hotplug/perf locking (
cpus_read_lock()inmem_spread_update_events()vsCPUHP_AP_ONLINE_DYNcallbacks, local-IRQ guard inmem_spread_cpu_offline(),static_branch_disable_cpuslocked()+synchronize_rcu()beforeperf_event_release_kernel()) and load-balancer integration (LBF_MEM,active_load_balance_mem_cpu_stop,mem_spread_kick) look sound.
Remaining Code/Build Blocker (fix before 03:00Z boot run)
- Guaranteed 32-bit SMP compile failure (
kernel/sched/core.c:171,175,kernel/sched/sched.h:2456,2474,kernel/sched/debug.c:65,117,120):- Commit
76e1d85fe6a5widenssysctl_sched_featuresfromunsigned inttounsigned longand addsstatic_assert(__SCHED_FEAT_NR <= BITS_PER_LONG);. - With
#2480(WAKE_SHORT_LOCAL) +#2481(FORK_LOCAL) +#2482(MEM_SPREAD),kernel/sched/features.hdefines 33 active features wheneverHAVE_RT_PUSH_IPI(CONFIG_IRQ_WORK && CONFIG_SMP) is enabled (__SCHED_FEAT_NR == 33). - On every 32-bit SMP architecture (ARM32, i386, RISC-V 32, etc.),
unsigned longis still 32 bits (BITS_PER_LONG == 32), sostatic_assert(__SCHED_FEAT_NR <= BITS_PER_LONG)unconditionally fails to build (33 <= 32) and1UL << 32is undefined behavior. - Fix: Widen
sysctl_sched_featurestou64(usingBIT_ULL()/1ULL <<incore.c,sched.h, anddebug.c, withstatic_assert(__SCHED_FEAT_NR <= 64)), so both 32-bit and 64-bit SMP configs build cleanly.
- Commit
Non-blocking Nits
kernel/sched/sched.hstill has 4 unrelated blank-line deletions in commit3732ea280422(lines 1004, 3630, 3656, 3731).- The PR description still lists the old 5-commit stack including
ASYM_SPREAD; please refresh it to match the 3-commit series.
Remaining Stacking / CI / §5 Gates
- Attribution (§4): Pass — all 3 commits carry human author/committer + human
Signed-off-by:only, zero AI commit trailers; PR body disclosesAssisted-by:. - CI / Dependencies: 0 check runs while stacked on unmerged
#2481(#2480->#2481->#2482); also functionally depends on#2517(Apple PMU L1D read-miss cache map) and#2574(T6050 cache DT). - §5 Evidence / §2 Default: Exact-head hardware A/B rows (STREAM + 7-Zip + CPU hotplug/S2R across T6050 and M1/M2/M4/A18 Pro with
#2517, plus 0 AVC / 0 failed units / 0 new kernel errors) remain pending before approval/default-on.
Each scheduler feature is a bit of sysctl_sched_features, previously an unsigned int with 1UL shifts. With every feature this tree has enabled on SMP (including HAVE_RT_PUSH_IPI), the 32 bits are exhausted and a 33rd feature overflows both unsigned int and 32-bit unsigned long without warning. Widen sysctl_sched_features to u64, switch the feature bit shifts in core.c, sched.h, and debug.c to 1ULL, and assert at build time that __SCHED_FEAT_NR fits in 64 bits so both 32-bit and 64-bit SMP builds succeed. Signed-off-by: Satya Benson <satya@benson.earth>
On an M5 Max (T6050) memory bandwidth is limited per cluster: about 190 GB/s for the six Everest cores and 140 GB/s for a six-core Sawtooth cluster, while one STREAM triad thread alone gets 130 GB/s. Linux packs two to five triad threads onto the Everest cores, as the capacity rules intend, and gets 187-195 GB/s; macOS on the same machine spreads them over the three clusters within a few hundred milliseconds and gets 248-342 GB/s, while it keeps up to six compute-bound threads on the Everest cores. ASYM_SPREAD cannot do that: it spreads every task once the biggest CPUs are full, which costs 6-thread 7-Zip 11%, and does nothing below six threads. Tell the two kinds of task apart from the CPU PMU. With MEM_SPREAD on, the scheduler keeps one pinned CPU-wide perf counter per CPU, of the generic L1D read miss event, reads it at the tick, and charges the misses per microsecond of running to the current task when it ran the whole tick period (no context switch since the previous tick, so the switch path is not touched). A per-task moving average (weight 2^-shift per sample, 1/8 by default) with hysteresis (memory-bound from 500 misses per us, no longer below 250) marks memory-bound tasks; children inherit the mark. On the M5 Max a triad thread misses 6,600 times per us alone on an Everest core, 1,600 with six sharing that cluster and 2,000 alone on a Sawtooth core; dependent adds miss 0-1 times. Stall events do not separate them: a dependent add chain stalls the back end on 84-89% of cycles against 48-64% for triad, and the cycles the oldest load waits on an L1D miss grow with contention (1% of cycles alone, 50% with six threads on a cluster), so that signal would collapse as soon as a task is spread. Place only the marked tasks differently: - when balancing between LLCs, an idle CPU pulls one from the group running the most of them if its own group runs at least two fewer, pushing it with active balance when it is running; the first one still goes to the biggest CPUs, and two to six end up 1/1/0, 1/1/1, 2/1/1, 2/2/1 and 2/2/2; - a busy CPU running one kicks the idle balancer when another LLC with an idle CPU runs two fewer; - they are never misfits, so bigger CPUs do not pull them back; - they wake on their previous CPU when it is idle, or on an idle CPU of its LLC, instead of the biggest idle CPU or next to their waker. Other tasks are placed as before. The counter takes one general-purpose counter per CPU while it exists, leaving the rest to perf; it exists while MEM_SPREAD is on, or while debugfs sched/mem_spread/sample is set, which classifies without changing placement. sched/mem_spread/ also has the thresholds (high, low), the averaging (shift) and a per-CPU status; /proc/PID/sched shows se.mem_rate and se.mem_bound. Without a PMU that counts L1D read misses nothing is classified. Off by default. Signed-off-by: Satya Benson <satya@benson.earth>
…plug The counters were only set up when the feature was switched on in debugfs. Set them up at boot from a late sync initcall, after the CPU PMU drivers have probed, and follow CPU hotplug: perf takes CPU-wide events off a CPU that goes offline and does not put them back when it returns (suspend to RAM does that to every secondary CPU), so a CPU going down releases its counter before perf's teardown, and one coming up gets a new one while MEM_SPREAD or sample is on. The work that sets them up or releases them now holds the CPU hotplug lock throughout, so it and the hotplug callbacks see one setting; that replaces its mutex. The first setup logs how many CPUs count. MEM_SPREAD stays off by default. On the M5 Max (T6050) it brings STREAM triad with 2-7 OpenMP threads from 178-289 GB/s to 247-372 GB/s and the pthread triad with 2-6 threads to 249-383 GB/s, against macOS's 248-350, with compute staying on the Everest cores (7-Zip scores the same with 6 threads and with 18). But its thresholds (500 and 250 misses per microsecond, shift 3) were set from M5 Max cores alone, so a default would be chosen by where it was tried, not by a hardware property. It can be turned on at run time in debugfs sched/features; the boot-time setup and the hotplug handling take effect then, or when sched/mem_spread/sample is turned on. Signed-off-by: Satya Benson <satya@benson.earth>
bc2c4ec to
78ebc6a
Compare
|
Gemini 4 Neon on @satchlj's behalf. Addressed the 32-bit SMP build blocker and both non-blocking nits from the review at
Verification (
Exact-head J775c hardware A/B + hotplug + §5 regression rows are queued after the |
There was a problem hiding this comment.
Code re-review at verified live head 78ebc6a42d1742f8770a755ec5688907d531cefc.
- 32-bit SMP build blocker — CLEARED: Commit
20a6354fc503cleanly widenssysctl_sched_featurestou64with1ULL <<shifts acrosskernel/sched/{core.c,debug.c,sched.h}andstatic_assert(__SCHED_FEAT_NR <= 64). All 3 commits carry human author/committer + humanSigned-off-by:only. - 0 remaining code/policy/attribution blockers. Ready to proceed once stacked base
#2481(and#2517/#2574) land, this PR is retargeted ontointegration/aurorawith green CI, and the exact-head §5 hardware row is posted.
|
Gemini 4 Neon on @satchlj's behalf. Hardware verification at
Results
|
There was a problem hiding this comment.
Formal §1–§6 pre-PR re-review at verified live head 78ebc6a42d1742f8770a755ec5688907d531cefc — holding APPROVE on stacked base retarget + green CI only.
Cleared (§1–§6 Code, Attribution & Exact-Head J775c §5 Row)
- §1–§3 Code / Safety: Pass — all 3 commits (
20a6354fc503,c6238aacd116,78ebc6a42d17) are clean:sysctl_sched_featuresis widened tou64with1ULL <<shifts andstatic_assert(__SCHED_FEAT_NR <= 64)(32-bit/64-bit SMP safe), boot-timesched_mem_spread_update()is guarded byif (mem_spread_wanted()), hotplug/perf teardown synchronization (cpus_read_lock()+local_irq_save()+static_branch_disable_cpuslocked()+synchronize_rcu()) is sound, andSCHED_FEAT(MEM_SPREAD, false)keeps stock behavior unchanged by default. - §4 Clean-room & attribution: Pass — all 3 commits carry human author/committer (
Satya Benson) and humanSigned-off-by:only, zero AI commit trailers. - §5 Evidence (J775c): Exact-head
78ebc6a42d17row (lobata,7.3.0-posth4-b2+, with#2574cache topology and#2517PMU map, 2 interleaved rounds) verifies all 33 features exposed,MEM_SPREADdefaults off, enabling logssched: MEM_SPREAD: counting L1D load misses on 18 CPUscleanly, STREAM Triad jumps+27%(2T181 -> 231 GB/s),+72%(4T179 -> 308 GB/s), and+93%(6T165 -> 320 GB/s), 7-Zip 6T/18T stays flat, and health checks show 0 new failed units, 0 new kernel errors beyond baseline, and 0WARNING/BUG/Oops/Call Trace. - §6 Naming: Pass.
Remaining Merge Gate (Blocking APPROVE)
- Stacked base & 0 CI runs: Base branch is still
satchlj/sched-fork-exec-llc-20261119(#2481, stacked on#2480), sostatusCheckRolluphas 0 check runs. Once#2480and#2481merge, retarget#2482ontointegration/aurorasohost-testsruns green — ready for immediateAPPROVEonce CI passes.
(Non-blocking notes for any future default-on follow-up: note the consistent -4.8% STREAM 18T delta across both rounds [330.8 / 333.1 GB/s off -> 316.0 / 316.2 GB/s on], runtime CPU offline/online hotplug callbacks remain untested on hardware because lobata builds with CONFIG_HOTPLUG_CPU=n, and cross-SoC M1/M2/M4/A18 Pro rows with #2517 + #2574 will be needed before proposing default-on.)
DjDeveloperr
left a comment
There was a problem hiding this comment.
Verdict: FINISH, then merge at 78ebc6a42d17
Blockers:
kernel/sched/features.h:SCHED_FEAT(MEM_SPREAD, false): the feature only runs after a manual debugfs write, and merged features have to work on a default boot. The PR body gives the reason:sysctl_mem_spread_high/_low/_shift(kernel/sched/fair.c) were set from M5 Max cores only. Fix: derive the thresholds from something the machine reports (a PMU or cache property), or back them with rows from other cores, then turn the feature on by default.- Missing row: nothing has run on this tree yet. As the body says, the STREAM and 7-Zip numbers came from private kernels with a different PMU cache map. Fix: a J775c A/B at the head on a kernel with #2517, so the L1D read-miss event counts, and with the
MEM_SPREAD: countingline in dmesg.
Checked: no Apple material, no chip gates; ASYM_SPREAD is gone and the history is three commits; the u64 feature mask has a static_assert. It is still stacked on #2481 and needs #2517 to classify anything. This replaces my earlier review: the history, body and CI points in it aren't blockers.
Evidence
Read 20a6354f, c6238aac and 78ebc6a4, and the 11-20 to 11-24 thread with Ryan. The lab rows Ryan offered (M1 Pro, M2, M4 Pro, A18 Pro, with #2517) are what back a default for item 1.
Superseded by the review at 78ebc6a
|
Merge readiness at
Areas: none matched in CODEOWNERS Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
…d-mem-spread-20261119 Signed-off-by: Satya Benson <satya@benson.earth>
Previously MEM_SPREAD classified tasks using raw L1D load misses per microsecond with M5 Max-specific thresholds (500/250 misses/us) and stayed disabled by default. Raw misses per microsecond scales directly with clock frequency, so fixed thresholds do not carry cleanly across slower clusters, DVFS states, or other Apple Silicon generations. Normalize each tick's L1D load-miss count into misses per 1,000 estimated active cycles (MPKC) using each CPU's reported hardware maximum frequency (cpufreq_get_hw_max_freq(), also updated via CPUFREQ_CREATE_POLICY for modular cpufreq drivers) scaled by live frequency invariance (arch_scale_freq_capacity()). This removes clock and DVFS dependence with no extra PMU counter: streaming workloads sustain 140-840 MPKC even under cluster contention while cache-heavy compute (7-Zip) stays at 15-16 MPKC across both P and M cores, cleanly separated by the 100/50 MPKC hysteresis thresholds (1 miss per 10 cycles to classify, below 1 per 20 to clear). Gate default-on PMU counter allocation on multi-LLC topologies so single-LLC systems incur zero PMU counter overhead unless debugfs sample mode is explicitly enabled, expose per-CPU max_khz in mem_spread/status, and enable SCHED_FEAT(MEM_SPREAD, true) by default. Signed-off-by: Satya Benson <satya@benson.earth>
|
Updated What changed at
|
| Benchmark | Threads | MEM_SPREAD ON (ABBA runs / mean) |
NO_MEM_SPREAD OFF (ABBA runs / mean) |
Delta |
|---|---|---|---|---|
| STREAM Triad (GB/s) | 1T | 123.9 / 124.0 (124.0) |
123.9 / 123.9 (123.9) |
+0.1% |
| STREAM Triad (GB/s) | 2T | 235.5 / 236.7 (236.1) |
178.7 / 177.5 (178.1) |
+32.6% |
| STREAM Triad (GB/s) | 4T | 302.1 / 245.1 (273.6) |
173.2 / 173.3 (173.3) |
+57.9% |
| STREAM Triad (GB/s) | 6T | 319.9 / 320.1 (320.0) |
247.8 / 237.4 (242.6) |
+31.9% |
| STREAM Triad (GB/s) | 12T | 323.7 / 321.7 (322.7) |
330.8 / 322.8 (326.8) |
-1.3% |
| STREAM Triad (GB/s) | 18T | 315.5 / 315.7 (315.6) |
310.4 / 330.3 (320.3) |
-1.5% |
7-Zip 7z b 1 (Tot MIPS) |
1T | 11,664 / 11,868 (11,766) |
11,877 / 11,904 (11,891) |
-1.0% |
7-Zip 7z b 1 (Tot MIPS) |
6T | 74,674 / 75,139 (74,907) |
75,514 / 75,615 (75,565) |
-0.9% |
7-Zip 7z b 1 (Tot MIPS) |
18T | 166,906 / 167,766 (167,336) |
169,130 / 166,936 (168,033) |
-0.4% |
Ready for re-review @DjDeveloperr (cc @RyanTheTide).
DjDeveloperr
left a comment
There was a problem hiding this comment.
Reviewed full 857-line diff at c1013c516908: widening sysctl_sched_features to u64 with static_assert(__SCHED_FEAT_NR <= 64), normalizing L1D load misses by estimated active cycles (MPKC via cpufreq_get_hw_max_freq() + CPUFREQ_CREATE_POLICY notifier and arch_scale_freq_capacity()), gating default-on PMU counter allocation on mem_spread_multi_llc(), and CPU hotplug / RCU teardown are all clean. Clearing the earlier changes-requested review; holding merge behind #2481 for a second-generation multi-LLC Mac exact-head row.
What: Spread memory-bandwidth-bound tasks across last-level caches (LLCs) on multi-LLC systems (
MEM_SPREAD, stacked on#2481and#2517). Normalizes each tick's L1D load-miss count into misses per 1,000 estimated active cycles (MPKC) using each CPU's hardware maximum frequency (cpufreq_get_hw_max_freq(), updated viaCPUFREQ_CREATE_POLICYfor modular cpufreq drivers) scaled by live frequency invariance (arch_scale_freq_capacity()), with 100/50 MPKC hysteresis thresholds (1 miss per 10 cycles to classify, below 1 per 20 to clear). Gates default-on PMU counter allocation on multi-LLC topologies so single-LLC systems incur zero PMU counter overhead unless debugfs sample mode is explicitly enabled, exposes per-CPUmax_khzin/sys/kernel/debug/sched/mem_spread/status, and enablesSCHED_FEAT(MEM_SPREAD, true)by default.Tested:
c1013c516908(kernel7.3.0-b110-2482+withapple,t6050-pmu+#2574shared L2 cache topology): PASS.FORK_LOCALandMEM_SPREADON by default;sched: MEM_SPREAD: counting L1D load misses on 18 CPUs;classifying 1 placing 1across all 18 CPUs (max_khz 4380000M-cores,4608000P-cores);perf stat -e cycles,L1-dcache-load-misses -- truecoexists cleanly (602,660cycles,23,976L1D load misses); live 6T STREAM classifies all 6 threadsbound 1(306–384MPKC) spread 2-per-LLC while 6T 7-Zip staysbound 0. Same-boot ABBA palindrome (MEM_SPREADON vsNO_MEM_SPREADOFF): STREAM OpenMP Triad 2T236.1vs178.1GB/s (+32.6%), 4T273.6vs173.3GB/s (+57.9%), 6T320.0vs242.6GB/s (+31.9%), 1T124.0vs123.9GB/s, 12T322.7vs326.8GB/s, 18T315.6vs320.3GB/s; 7-Zip parity (1T11,766vs11,891, 6T74,907vs75,565, 18T167,336vs168,033MIPS). Regression:0failed systemd units,0kernel taint,0WARNING/BUG/Oops/Call trace.scripts/checkpatch.pl --strict --git HEAD~1..HEAD:0 errors, 0 warnings, 0 checks.Risk: two-way door; multi-LLC SMP systems with a working generic L1D load-miss PMU counter (no-op on single-LLC systems, which allocate zero PMU counters by default; runtime toggleable via
echo NO_MEM_SPREAD > /sys/kernel/debug/sched/features). Holds one general-purpose PMU counter per CPU on multi-LLC machines while enabled.Not yet: Multi-LLC rows on other SoCs (e.g., M1/M2/M4 Pro/Max/Ultra) and CPU hotplug offline/online testing on a PSCI-hotplug machine (T6050 uses
spin-tablewithout/sys/devices/system/cpu/cpu*/online).Commit series
sched: Make sysctl_sched_features a u64— widens feature bitmask tou64withstatic_assert(__SCHED_FEAT_NR <= 64).sched/fair: Spread memory-bound tasks across LLCs (MEM_SPREAD)— classifies memory-bound tasks via pinned per-CPU L1D-read-miss counters and spreads only memory-bound tasks across LLCs.sched/fair: Set up the MEM_SPREAD counters at boot and across CPU hotplug— sets up counters at boot and tracks CPU hotplug.sched/fair: normalize MEM_SPREAD by CPU clock rate and enable by default(c1013c516908) — replaces raw misses/us with clock-normalized MPKC (100/50hysteresis), gates default-on PMU allocation on multi-LLC topologies, exposes per-CPUmax_khz, and enablesMEM_SPREADby default.