diff options
| author | Peter Zijlstra <peterz@infradead.org> | 2026-05-19 12:18:01 +0200 |
|---|---|---|
| committer | Peter Zijlstra <peterz@infradead.org> | 2026-05-19 12:18:01 +0200 |
| commit | a26d9208c1376ac3877d9f12e697f83368e2af1c (patch) | |
| tree | 1f68b9ae26b8b88a7d1f24fea2a6df87e4c0fee5 /arch | |
| parent | dd29c017aed628076e915fe4cdfb5392fd4c5cab (diff) | |
| parent | c99b8593b060931c5a0a4b701689f8d6a2c00dbf (diff) | |
| download | linux-next-a26d9208c1376ac3877d9f12e697f83368e2af1c.tar.gz linux-next-a26d9208c1376ac3877d9f12e697f83368e2af1c.zip | |
Merge branch 'sched/cache'
Merge the cache aware balancer topic branch.
# Conflicts:
# kernel/sched/topology.c
Diffstat (limited to 'arch')
| -rw-r--r-- | arch/x86/include/asm/processor.h | 5 | ||||
| -rw-r--r-- | arch/x86/kernel/smpboot.c | 20 |
2 files changed, 25 insertions, 0 deletions
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h index 10b5355b323e..eb9fce94620d 100644 --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h @@ -704,6 +704,11 @@ static inline u32 per_cpu_l2c_id(unsigned int cpu) return per_cpu(cpu_info.topo.l2c_id, cpu); } +static inline u32 per_cpu_core_id(unsigned int cpu) +{ + return per_cpu(cpu_info.topo.core_id, cpu); +} + #ifdef CONFIG_CPU_SUP_AMD /* * Issue a DIV 0/1 insn to clear any division data from previous DIV diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index 294a8ea60298..cb999feb66b0 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c @@ -424,6 +424,21 @@ static const struct x86_cpu_id intel_cod_cpu[] = { {} }; +/* + * Allows splitting the LLC by matching 'core_id % split_llc'. + * + * This is mostly a debug hack to emulate systems with multiple LLCs per node + * on systems that do not naturally have this. + */ +static unsigned int split_llc = 0; + +static int __init split_llc_setup(char *str) +{ + get_option(&str, &split_llc); + return 0; +} +early_param("split_llc", split_llc_setup); + static bool match_llc(struct cpuinfo_x86 *c, struct cpuinfo_x86 *o) { const struct x86_cpu_id *id = x86_match_cpu(intel_cod_cpu); @@ -438,6 +453,11 @@ static bool match_llc(struct cpuinfo_x86 *c, struct cpuinfo_x86 *o) if (per_cpu_llc_id(cpu1) != per_cpu_llc_id(cpu2)) return false; + if (split_llc && + (per_cpu_core_id(cpu1) % split_llc) != + (per_cpu_core_id(cpu2) % split_llc)) + return false; + /* * Allow the SNC topology without warning. Return of false * means 'c' does not share the LLC of 'o'. This will be |
