Search code examples
linuxx86-64intelcpu-architecturecpu-cores

How to detect E-cores and P-cores in Linux alder lake system?


How can I check particular cpu core belongs to P-core or E-core group? Is there any way to list information about Performance/Energy cores in a running Linux x86_64 alder lake system? Like, Printing any of the sysfs parameters?


Solution

  • We can identify which core has SMT (hyper-threading) enabled. Run:

    lscpu --all --extended
    

    This is the result for 12900K:

    ➜ lscpu --all --extended
    CPU NODE SOCKET CORE L1d:L1i:L2:L3 ONLINE    MAXMHZ   MINMHZ
      0    0      0    0 0:0:0:0          yes 6700.0000 800.0000
      1    0      0    0 0:0:0:0          yes 6700.0000 800.0000
      2    0      0    1 1:1:1:0          yes 6700.0000 800.0000
      3    0      0    1 1:1:1:0          yes 6700.0000 800.0000
      4    0      0    2 2:2:2:0          yes 6500.0000 800.0000
      5    0      0    2 2:2:2:0          yes 6500.0000 800.0000
      6    0      0    3 3:3:3:0          yes 6500.0000 800.0000
      7    0      0    3 3:3:3:0          yes 6500.0000 800.0000
      8    0      0    4 4:4:4:0          yes 6500.0000 800.0000
      9    0      0    4 4:4:4:0          yes 6500.0000 800.0000
     10    0      0    5 5:5:5:0          yes 6500.0000 800.0000
     11    0      0    5 5:5:5:0          yes 6500.0000 800.0000
     12    0      0    6 6:6:6:0          yes 6500.0000 800.0000
     13    0      0    6 6:6:6:0          yes 6500.0000 800.0000
     14    0      0    7 7:7:7:0          yes 6500.0000 800.0000
     15    0      0    7 7:7:7:0          yes 6500.0000 800.0000
     16    0      0    8 8:8:8:0          yes 3900.0000 800.0000
     17    0      0    9 9:9:8:0          yes 3900.0000 800.0000
     18    0      0   10 10:10:8:0        yes 3900.0000 800.0000
     19    0      0   11 11:11:8:0        yes 3900.0000 800.0000
     20    0      0   12 12:12:9:0        yes 3900.0000 800.0000
     21    0      0   13 13:13:9:0        yes 3900.0000 800.0000
     22    0      0   14 14:14:9:0        yes 3900.0000 800.0000
     23    0      0   15 15:15:9:0        yes 3900.0000 800.0000
    

    Now, look at the CPU column and CORE column. For example:

    • CPU 0 and CPU 1 belong to CORE 0. Therefore, CORE 0 is a P-core with SMT.
    • CPU 16 belongs to CORE 8. Therefore, CORE 8 is an E-core.

    Note that this method will only work if you haven't explicitly disabled P-core's SMT in BIOS. If you disabled SMT in BIOS, you may look at the MAXMHZ column as suggested in Peter's comment.