Skip to content

Commit 55409ac

Browse files
author
Peter Zijlstra
committed
sched,x86: Fix L2 cache mask
Currently AMD/Hygon do not populate l2c_id, this means that for SMT enabled systems they report an L2 per thread. This is ofcourse not true but was harmless so far. However, since commit: 66558b7 ("sched: Add cluster scheduler level for x86") the scheduler topology setup requires: SMT <= L2 <= LLC Which leads to noisy warnings and possibly weird behaviour on affected chips. Therefore change the topology generation such that if l2c_id is not populated it follows the SMT topology, thereby satisfying the constraint. Fixes: 66558b7 ("sched: Add cluster scheduler level for x86") Reported-by: Tom Lendacky <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Tested-by: Tom Lendacky <[email protected]>
1 parent eaed27d commit 55409ac

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/x86/kernel/smpboot.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -470,9 +470,9 @@ static bool match_l2c(struct cpuinfo_x86 *c, struct cpuinfo_x86 *o)
470470
{
471471
int cpu1 = c->cpu_index, cpu2 = o->cpu_index;
472472

473-
/* Do not match if we do not have a valid APICID for cpu: */
473+
/* If the arch didn't set up l2c_id, fall back to SMT */
474474
if (per_cpu(cpu_l2c_id, cpu1) == BAD_APICID)
475-
return false;
475+
return match_smt(c, o);
476476

477477
/* Do not match if L2 cache id does not match: */
478478
if (per_cpu(cpu_l2c_id, cpu1) != per_cpu(cpu_l2c_id, cpu2))

0 commit comments

Comments
 (0)