microfetch icon indicating copy to clipboard operation
microfetch copied to clipboard

Topology counts P/E threads as cores and reports a phantom E-core on non-hybrid Alder Lake

Open OptimoSupreme opened this issue 1 month ago • 0 comments

On an i5-12400F (6 P-cores, 0 E-cores, 12 threads) the Topology line reads:

Topology      6 cores (12p/1e), 12 threads

Expected: 6 cores, 12 threads (or 6p/0e). Two causes in crates/lib/src/cpu.rs:

  1. /sys/devices/cpu_core/cpus and /sys/devices/cpu_atom/cpus list logical CPUs, not cores. get_pe_cores counts the entries directly, so SMT doubles the P count. On this box the file holds 0-11.
  2. Alder Lake parts with the E-cores fused off still register the atom PMU, but its cpulist is empty (just \n). count_cpulist parses no digits, counts one entry anyway, then skips the newline, giving a phantom E-core.

Any 12th gen+ Intel without E-cores (12400, 12500, non-K 12600) hits both. Parts with E-cores get an inflated P count only.

$ od -c /sys/devices/cpu_atom/cpus
0000000  \n
$ cat /sys/devices/cpu_core/cpus
0-11
$ cat /sys/devices/system/cpu/cpu0/topology/thread_siblings_list
0-1

microfetch 1.1.0 from nixpkgs, kernel 7.2.8. Same code on main. PR incoming.

OptimoSupreme avatar Oct 12 '26 04:10 OptimoSupreme