Linux Power Management development
 help / color / mirror / Atom feed
From: Aaron Rainbolt <arainbolt@kfocus.org>
To: srinivas.pandruvada@linux.intel.com
Cc: arainbolt@kfocus.org, kernel-team@lists.ubuntu.com,
	lenb@kernel.org, linux-acpi@vger.kernel.org,
	linux-pm@vger.kernel.org, mmikowski@kfocus.org,
	rjw@rjwysocki.net
Subject: Re: [BUG] intel_pstate: CPU frequencies miscalculated/incorrectly detected on Arrow Lake hardware
Date: Sun, 14 Dec 2025 18:45:07 -0600	[thread overview]
Message-ID: <20251214184507.21f95134@kf-m2g5> (raw)
In-Reply-To: <849e7394b8c7c4b74d1d55648a8d4b55b49aa91a.camel@linux.intel.com>

[-- Attachment #1: Type: text/plain, Size: 26057 bytes --]

Hi Srinivas:

We do not have the X580WNT-G available at the moment. It was included
to show the wide sample of devices showing this bug but has left the
office for now. However, we do have a bench model of the X560WNR-G
always available, so I have included results for that model instead.
The issues present are the same. I hope that's ok.

> To check, I need dump of:
> m=$(getconf _NPROCESSORS_ONLN); for ((i=0; i<m; i++)); do echo CPU$i;
> sudo rdmsr -p $i 0x771;  sudo rdmsr -p $i 0x774; done

Here are the results of running the above script on the X560WNR-G on
the mainline kernel 6.18.0-061800-generic installed from
https://kernel.ubuntu.com/mainline/v6.18. The results are EXACTLY the
same as the 6.14 kernel:

  CPU0
  11a203d
  40003d0d
  CPU1
  11a203d
  40003d0d
  CPU2
  11a203f
  40003f0e
  CPU3
  11a203f
  40003f0e
  CPU4
  11a203d
  40003d0d
  CPU5
  11a203d
  40003d0d
  CPU6
  11a203d
  40003d0d
  CPU7
  11a203d
  40003d0d
  CPU8
  10f152e
  40002e0c
  CPU9
  10f152e
  40002e0c
  CPU10
  10f152e
  40002e0c
  CPU11
  10f152e
  40002e0c
  CPU12
  10f152e
  40002e0c
  CPU13
  10f152e
  40002e0c
  CPU14
  10f152e
  40002e0c
  CPU15
  10f152e
  40002e0c
  CPU16
  10f152e
  40002e0a
  CPU17
  10f152e
  40002e0a
  CPU18
  10f152e
  40002e0c
  CPU19
  10f152e
  40002e0c
  CPU20
  10f152e
  40002e0c
  CPU21
  10f152e
  40002e0c
  CPU22
  10f152e
  40002e0c
  CPU23
  10f152e
  40002e0c

> What command you to report " M-Test  . Id"?

We wrote the attached `check-intel-cpu-freq` script to find this value.
It scans P- and E-core groups and finds the maximum current frequency
and what core provided it. That value is read from the sysfs file found
for each core like so:
`/sys/devices/system/cpu/cpufreq/policy7/scaling_cur_freq`. This script
scan each group 200 times, so there are 200 x 8 = 1600 P-core samples
and 200 x 16 = 3200 E-core samples. The script directs one to use
Geekbench5 to stress the cores while it is running. Here are the
results with the mainline 6.18 kernel. The Assesment is identical with
the results we got with the 6.14 and 6.18-rc7 kernels:

  ## Clevo | X560WNR-G | Ultra 9 275HX | kernel 6.18.0-061800-generic (Mainline)

  Type |Turbo|B-Claim . Id|B-Spec |M-Claim . Id|M-Spec |M-Test  . Id
  -----|-----|------------|-------|------------|-------|------------
  P    |off  |2000000 . 07|2700000|2000000 . 07|2700000|2700027 . 01
  P    |ON   |2000000 . 07|2700000|3900000 . 03|5400000|5400000 . 03
  E    |off  |2100000 . 17|2100000|2100000 . 17|2100000|2133426 . 11
  E    |ON   |2100000 . 17|2100000|4600000 . 17|4600000|4694736 . 15

  ## Assessment

  1. The E-cores are all expressed as expected
  2. The P-cores show base freq claimed (B-Claim) at 2000000, but specified
     (B-Spec) and measured (M-Test) are 2700000.
  3. The P-cores show max freq claimed (M-Claim) at 3900000, but specified
     (M-Spec) and measured (M-Test) are 5400000.

  ## Key

  Column  | Values | Purpose
  --------|--------|---------
  Type    | P|E    | The subset of cores this row applied to.
          |        |   For example, `P` means `all P-cores`.
  Turbo   | off|ON | The turbo setting of this core subset.
  B-Claim | int Hz | The max `base_frequency` value of this core subset.
       Id | int    | The core id that provided the Base-Claim value.
  B-Spec  | int Hz | Intel SPEC'D BASE freq for this CPU's core Type.
  M-Claim | int Hz | The max `cpuinfo_max_freq` value of this core subset.
       Id | int    | The core id that provided the Max-Claim value.
  M-Spec  | int Hz | Intel SPEC'D MAX freq for this CPU's core Type.
  M-Test  | int Hz | The max `scaling_cur_freq` value of this core subset.
          |        |   The entire core subset is sampled 200x.
       Id | int    | The core id that provided the Max-Test value.


> One addition, to show measured freq, use
> sudo turbostat --show frequency

We couldn't easily run this on the 6.18 mainline kernel because the
linux-tools package in Ubuntu is not available. However, we ran this
with the 6.14 kernel, which showed the same P-core frequency issues in
our testing. When we continued to run and pushed the cores, the Bzy_Mhz
values approached the theoretical maximums. Let me know if you require
more than this:

  X560WNR-G $ sudo turbostat --show frequency
  turbostat version 2025.02.02 - Len Brown <lenb@kernel.org>
  Kernel command line: BOOT_IMAGE=/@boot/vmlinuz-6.14.0-34-kfocus root=UUID=09e835be-39d5-42fa-8b81-39f5a40f98de ro rootflags=subvol=@ quiet cryptdevice=UUID=2cd8437a-4d06-4050-bf06-247f233d7d76:luks-2cd8437a-4d06-4050-bf06-247f233d7d76 root=/dev/mapper/luks-2cd8437a-4d06-4050-bf06-247f233d7d76 splash modprobe.blacklist=nouveau nouveau.modeset=0 modprobe.blacklist=ucsi_acpi vt.handoff=7
  CPUID(0): GenuineIntel 0x23 CPUID levels
  CPUID(1): family:model:stepping 0x6:c6:2 (6:198:2) microcode 0x119
  CPUID(0x80000000): max_extended_levels: 0x80000008
  CPUID(1): SSE3 MONITOR SMX EIST TM2 TSC MSR ACPI-TM HT TM
  CPUID(6): APERF, TURBO, DTS, PTM, HWP, HWPnotify, HWPwindow, HWPepp, HWPpkg, EPB
  cpu0: MSR_IA32_MISC_ENABLE: 0x00850089 (TCC EIST MWAIT PREFETCH TURBO)
  CPUID(7): No-SGX Hybrid
  CPUID(0x15): eax_crystal: 2 ebx_tsc: 160 ecx_crystal_hz: 38400000
  TSC: 3072 MHz (38400000 Hz * 160 / 2 / 1000000)
  CPUID(0x16): base_mhz: 3100 max_mhz: 4600 bus_mhz: 100
  cpu0: MSR_PLATFORM_INFO: 0x804083cf1811f00
  8 * 100.0 = 800.0 MHz max efficiency frequency
  31 * 100.0 = 3100.0 MHz base frequency
  cpu0: MSR_TURBO_RATIO_LIMIT: 0x3434343434343636
  52 * 100.0 = 5200.0 MHz max turbo 8 active cores
  52 * 100.0 = 5200.0 MHz max turbo 7 active cores
  52 * 100.0 = 5200.0 MHz max turbo 6 active cores
  52 * 100.0 = 5200.0 MHz max turbo 5 active cores
  52 * 100.0 = 5200.0 MHz max turbo 4 active cores
  52 * 100.0 = 5200.0 MHz max turbo 3 active cores
  54 * 100.0 = 5400.0 MHz max turbo 2 active cores
  54 * 100.0 = 5400.0 MHz max turbo 1 active cores
  cpu0: MSR_SECONDARY_TURBO_RATIO_LIMIT: 0x2e2e2e2e2e2e2e2e
  46 * 100.0 = 4600.0 MHz max turbo 8 active cores
  46 * 100.0 = 4600.0 MHz max turbo 7 active cores
  46 * 100.0 = 4600.0 MHz max turbo 6 active cores
  46 * 100.0 = 4600.0 MHz max turbo 5 active cores
  46 * 100.0 = 4600.0 MHz max turbo 4 active cores
  46 * 100.0 = 4600.0 MHz max turbo 3 active cores
  46 * 100.0 = 4600.0 MHz max turbo 2 active cores
  46 * 100.0 = 4600.0 MHz max turbo 1 active cores
  cpu0: MSR_CONFIG_TDP_NOMINAL: 0x0000001b (base_ratio=27)
  cpu0: MSR_CONFIG_TDP_LEVEL_1: 0x00110168 (PKG_MIN_PWR_LVL1=0 PKG_MAX_PWR_LVL1=0 LVL1_RATIO=17 PKG_TDP_LVL1=360)
  cpu0: MSR_CONFIG_TDP_LEVEL_2: 0x001f0208 (PKG_MIN_PWR_LVL2=0 PKG_MAX_PWR_LVL2=0 LVL2_RATIO=31 PKG_TDP_LVL2=520)
  cpu0: MSR_CONFIG_TDP_CONTROL: 0x00000000 ( lock=0)
  cpu0: MSR_TURBO_ACTIVATION_RATIO: 0x0000001a (MAX_NON_TURBO_RATIO=26 lock=0)
  cpu0: cpufreq driver: intel_pstate
  cpu0: cpufreq governor: powersave
  cpufreq intel_pstate no_turbo: 0
  cpu0: MSR_MISC_PWR_MGMT: 0x000030c2 (ENable-EIST_Coordination ENable-EPB DISable-OOB)
  cpu0: MSR_PM_ENABLE: 0x00000001 (HWP)
  cpu0: MSR_HWP_CAPABILITIES: 0x011a203d (high 61 guar 32 eff 26 low 1)
  cpu0: MSR_HWP_REQUEST: 0x40003d0d (min 13 max 61 des 0 epp 0x40 window 0x0 pkg 0x0)
  cpu0: MSR_HWP_REQUEST_PKG: 0x8000ff01 (min 1 max 255 des 0 epp 0x80 window 0x0)
  cpu0: MSR_HWP_INTERRUPT: 0x00000005 (EN_Guaranteed_Perf_Change, Dis_Excursion_Min)
  cpu0: MSR_HWP_STATUS: 0x00000000 (No-Guaranteed_Perf_Change, No-Excursion_Min)
  cpu0: EPB: 6 (balanced)
  cpu0: MSR_IA32_POWER_CTL: 0x00e4005f (C1E auto-promotion: ENabled)
  cpu0: MSR_PKG_CST_CONFIG_CONTROL: 0x74008008 (UNdemote-C1, demote-C1, locked, pkg-cstate-limit=8 (unlimited))
  /dev/cpu_dma_latency: 2000000000 usec (default)
  current_driver: intel_idle
  current_governor: menu
  current_governor_ro: menu
  cpu0: POLL: CPUIDLE CORE POLL IDLE
  cpu0: C1ACPI: ACPI FFH MWAIT 0x0
  cpu0: C2ACPI: ACPI FFH MWAIT 0x21
  cpu0: C3ACPI: ACPI FFH MWAIT 0x60
  cpu0: MSR_PKGC3_IRTL: 0x00000000 (NOTvalid, 0 ns)
  cpu0: MSR_PKGC6_IRTL: 0x00000000 (NOTvalid, 0 ns)
  cpu0: MSR_PKGC8_IRTL: 0x00000000 (NOTvalid, 0 ns)
  cpu0: MSR_PKGC10_IRTL: 0x00000000 (NOTvalid, 0 ns)
  Uncore Frequency package0 die0: 800 - 3800 MHz (800 - 3800 MHz) 1800 MHz
  RAPL: 4766 sec. Joule Counter Range, at 55 Watts
  cpu0: MSR_RAPL_POWER_UNIT: 0x000a0e03 (0.125000 Watts, 0.000061 Joules, 0.000977 sec.)
  cpu0: MSR_PKG_POWER_INFO: 0x120000000001b8 (55 W TDP, RAPL 0 - 0 W, 0.017578 sec.)
  cpu0: MSR_PKG_POWER_LIMIT: 0x438500001f8640 (UNlocked)
  cpu0: PKG Limit #1: ENabled (200.000 Watts, 32.000000 sec, clamp ENabled)
  cpu0: PKG Limit #2: ENabled (160.000 Watts, 0.002441* sec, clamp ENabled)
  cpu0: MSR_VR_CURRENT_CONFIG: 0x00000850
  cpu0: PKG Limit #4: 266.000000 Watts (UNlocked)
  cpu0: MSR_DRAM_POWER_LIMIT: 0x00000000 (UNlocked)
  cpu0: DRAM Limit: DISabled (0.000 Watts, 0.000977 sec, clamp DISabled)
  cpu0: MSR_PP0_POLICY: 0
  cpu0: MSR_PP0_POWER_LIMIT: 0x00000000 (UNlocked)
  cpu0: Cores Limit: DISabled (0.000 Watts, 0.000977 sec, clamp DISabled)
  cpu0: MSR_PP1_POLICY: 0
  cpu0: MSR_PP1_POWER_LIMIT: 0x00000000 (UNlocked)
  cpu0: GFX Limit: DISabled (0.000 Watts, 0.000977 sec, clamp DISabled)
  cpu0: MSR_IA32_TEMPERATURE_TARGET: 0x0d690000 (92 C) (105 default - 13 offset)
  cpu0: MSR_IA32_PACKAGE_THERM_STATUS: 0x88320002 (55 C)
  cpu0: MSR_IA32_PACKAGE_THERM_INTERRUPT: 0x02000003 (105 C, 105 C)
  cpu0: MSR_MISC_FEATURE_CONTROL: 0x00000000 (L2-Prefetch L2-Prefetch-pair L1-Prefetch L1-IP-Prefetch)
  Avg_MHz Busy%   Bzy_MHz TSC_MHz GFXMHz  GFXAMHz SAMMHz  SAMAMHz UncMHz
  3       0.20    1594    3071    550     550     1300    1300    1800
  2       0.11    1945    3072    550     550     1300    1300    1800
  10      0.53    1818    3072
  1       0.06    1380    3072
  2       0.15    1416    3072
  1       0.09    1315    3072
  5       0.33    1410    3072
  6       0.45    1338    3072
  2       0.12    1531    3072
  2       0.15    1471    3072
  1       0.08    1375    3072
  4       0.17    2113    3072
  3       0.16    2085    3072
  1       0.04    2058    3072
  5       0.23    2016    3072
  14      0.98    1410    3072
  1       0.04    1422    3072
  1       0.10    1435    3072
  2       0.11    1471    3072
  2       0.17    1418    3072
  6       0.33    1684    3072
  2       0.13    1465    3072
  1       0.08    1714    3072
  0       0.02    2270    3072
  3       0.13    1969    3072

To keep everything in one place, here is the acpi_cppc report you
requested earlier also for the X560WNR-G using the 6.18 mainline
kernel. This is identical again to the 6.14 kernel EXCEPT for the
`feedback_crts` field, which appears to be dynamic.

  X560WNR-G $ grep . /sys/devices/system/cpu/cpu*/acpi_cppc/*
  /sys/devices/system/cpu/cpu0/acpi_cppc/feedback_ctrs:ref:85764085462 del:81092364612
  /sys/devices/system/cpu/cpu0/acpi_cppc/guaranteed_perf:32
  /sys/devices/system/cpu/cpu0/acpi_cppc/highest_perf:61
  /sys/devices/system/cpu/cpu0/acpi_cppc/lowest_freq:0
  /sys/devices/system/cpu/cpu0/acpi_cppc/lowest_nonlinear_perf:26
  /sys/devices/system/cpu/cpu0/acpi_cppc/lowest_perf:1
  /sys/devices/system/cpu/cpu0/acpi_cppc/nominal_freq:2700
  /sys/devices/system/cpu/cpu0/acpi_cppc/nominal_perf:43
  /sys/devices/system/cpu/cpu0/acpi_cppc/reference_perf:49
  /sys/devices/system/cpu/cpu0/acpi_cppc/wraparound_time:18446744073709551615
  /sys/devices/system/cpu/cpu10/acpi_cppc/feedback_ctrs:ref:30648952280 del:32319093196
  /sys/devices/system/cpu/cpu10/acpi_cppc/guaranteed_perf:21
  /sys/devices/system/cpu/cpu10/acpi_cppc/highest_perf:46
  /sys/devices/system/cpu/cpu10/acpi_cppc/lowest_freq:0
  /sys/devices/system/cpu/cpu10/acpi_cppc/lowest_nonlinear_perf:15
  /sys/devices/system/cpu/cpu10/acpi_cppc/lowest_perf:1
  /sys/devices/system/cpu/cpu10/acpi_cppc/nominal_freq:2100
  /sys/devices/system/cpu/cpu10/acpi_cppc/nominal_perf:29
  /sys/devices/system/cpu/cpu10/acpi_cppc/reference_perf:43
  /sys/devices/system/cpu/cpu10/acpi_cppc/wraparound_time:18446744073709551615
  /sys/devices/system/cpu/cpu11/acpi_cppc/feedback_ctrs:ref:24418501228 del:26064639390
  /sys/devices/system/cpu/cpu11/acpi_cppc/guaranteed_perf:21
  /sys/devices/system/cpu/cpu11/acpi_cppc/highest_perf:46
  /sys/devices/system/cpu/cpu11/acpi_cppc/lowest_freq:0
  /sys/devices/system/cpu/cpu11/acpi_cppc/lowest_nonlinear_perf:15
  /sys/devices/system/cpu/cpu11/acpi_cppc/lowest_perf:1
  /sys/devices/system/cpu/cpu11/acpi_cppc/nominal_freq:2100
  /sys/devices/system/cpu/cpu11/acpi_cppc/nominal_perf:29
  /sys/devices/system/cpu/cpu11/acpi_cppc/reference_perf:43
  /sys/devices/system/cpu/cpu11/acpi_cppc/wraparound_time:18446744073709551615
  /sys/devices/system/cpu/cpu12/acpi_cppc/feedback_ctrs:ref:30772876268 del:31630648127
  /sys/devices/system/cpu/cpu12/acpi_cppc/guaranteed_perf:21
  /sys/devices/system/cpu/cpu12/acpi_cppc/highest_perf:46
  /sys/devices/system/cpu/cpu12/acpi_cppc/lowest_freq:0
  /sys/devices/system/cpu/cpu12/acpi_cppc/lowest_nonlinear_perf:15
  /sys/devices/system/cpu/cpu12/acpi_cppc/lowest_perf:1
  /sys/devices/system/cpu/cpu12/acpi_cppc/nominal_freq:2100
  /sys/devices/system/cpu/cpu12/acpi_cppc/nominal_perf:29
  /sys/devices/system/cpu/cpu12/acpi_cppc/reference_perf:43
  /sys/devices/system/cpu/cpu12/acpi_cppc/wraparound_time:18446744073709551615
  /sys/devices/system/cpu/cpu13/acpi_cppc/feedback_ctrs:ref:32208013456 del:33858924907
  /sys/devices/system/cpu/cpu13/acpi_cppc/guaranteed_perf:21
  /sys/devices/system/cpu/cpu13/acpi_cppc/highest_perf:46
  /sys/devices/system/cpu/cpu13/acpi_cppc/lowest_freq:0
  /sys/devices/system/cpu/cpu13/acpi_cppc/lowest_nonlinear_perf:15
  /sys/devices/system/cpu/cpu13/acpi_cppc/lowest_perf:1
  /sys/devices/system/cpu/cpu13/acpi_cppc/nominal_freq:2100
  /sys/devices/system/cpu/cpu13/acpi_cppc/nominal_perf:29
  /sys/devices/system/cpu/cpu13/acpi_cppc/reference_perf:43
  /sys/devices/system/cpu/cpu13/acpi_cppc/wraparound_time:18446744073709551615
  /sys/devices/system/cpu/cpu14/acpi_cppc/feedback_ctrs:ref:34318996648 del:37357638199
  /sys/devices/system/cpu/cpu14/acpi_cppc/guaranteed_perf:21
  /sys/devices/system/cpu/cpu14/acpi_cppc/highest_perf:46
  /sys/devices/system/cpu/cpu14/acpi_cppc/lowest_freq:0
  /sys/devices/system/cpu/cpu14/acpi_cppc/lowest_nonlinear_perf:15
  /sys/devices/system/cpu/cpu14/acpi_cppc/lowest_perf:1
  /sys/devices/system/cpu/cpu14/acpi_cppc/nominal_freq:2100
  /sys/devices/system/cpu/cpu14/acpi_cppc/nominal_perf:29
  /sys/devices/system/cpu/cpu14/acpi_cppc/reference_perf:43
  /sys/devices/system/cpu/cpu14/acpi_cppc/wraparound_time:18446744073709551615
  /sys/devices/system/cpu/cpu15/acpi_cppc/feedback_ctrs:ref:41344894184 del:40523832261
  /sys/devices/system/cpu/cpu15/acpi_cppc/guaranteed_perf:21
  /sys/devices/system/cpu/cpu15/acpi_cppc/highest_perf:46
  /sys/devices/system/cpu/cpu15/acpi_cppc/lowest_freq:0
  /sys/devices/system/cpu/cpu15/acpi_cppc/lowest_nonlinear_perf:15
  /sys/devices/system/cpu/cpu15/acpi_cppc/lowest_perf:1
  /sys/devices/system/cpu/cpu15/acpi_cppc/nominal_freq:2100
  /sys/devices/system/cpu/cpu15/acpi_cppc/nominal_perf:29
  /sys/devices/system/cpu/cpu15/acpi_cppc/reference_perf:43
  /sys/devices/system/cpu/cpu15/acpi_cppc/wraparound_time:18446744073709551615
  /sys/devices/system/cpu/cpu16/acpi_cppc/feedback_ctrs:ref:36965175248 del:37144286195
  /sys/devices/system/cpu/cpu16/acpi_cppc/guaranteed_perf:21
  /sys/devices/system/cpu/cpu16/acpi_cppc/highest_perf:46
  /sys/devices/system/cpu/cpu16/acpi_cppc/lowest_freq:0
  /sys/devices/system/cpu/cpu16/acpi_cppc/lowest_nonlinear_perf:15
  /sys/devices/system/cpu/cpu16/acpi_cppc/lowest_perf:1
  /sys/devices/system/cpu/cpu16/acpi_cppc/nominal_freq:2100
  /sys/devices/system/cpu/cpu16/acpi_cppc/nominal_perf:21
  /sys/devices/system/cpu/cpu16/acpi_cppc/reference_perf:31
  /sys/devices/system/cpu/cpu16/acpi_cppc/wraparound_time:18446744073709551615
  /sys/devices/system/cpu/cpu17/acpi_cppc/feedback_ctrs:ref:29796395364 del:30507895794
  /sys/devices/system/cpu/cpu17/acpi_cppc/guaranteed_perf:21
  /sys/devices/system/cpu/cpu17/acpi_cppc/highest_perf:46
  /sys/devices/system/cpu/cpu17/acpi_cppc/lowest_freq:0
  /sys/devices/system/cpu/cpu17/acpi_cppc/lowest_nonlinear_perf:15
  /sys/devices/system/cpu/cpu17/acpi_cppc/lowest_perf:1
  /sys/devices/system/cpu/cpu17/acpi_cppc/nominal_freq:2100
  /sys/devices/system/cpu/cpu17/acpi_cppc/nominal_perf:21
  /sys/devices/system/cpu/cpu17/acpi_cppc/reference_perf:31
  /sys/devices/system/cpu/cpu17/acpi_cppc/wraparound_time:18446744073709551615
  /sys/devices/system/cpu/cpu18/acpi_cppc/feedback_ctrs:ref:30008884864 del:31394469575
  /sys/devices/system/cpu/cpu18/acpi_cppc/guaranteed_perf:21
  /sys/devices/system/cpu/cpu18/acpi_cppc/highest_perf:46
  /sys/devices/system/cpu/cpu18/acpi_cppc/lowest_freq:0
  /sys/devices/system/cpu/cpu18/acpi_cppc/lowest_nonlinear_perf:15
  /sys/devices/system/cpu/cpu18/acpi_cppc/lowest_perf:1
  /sys/devices/system/cpu/cpu18/acpi_cppc/nominal_freq:2100
  /sys/devices/system/cpu/cpu18/acpi_cppc/nominal_perf:29
  /sys/devices/system/cpu/cpu18/acpi_cppc/reference_perf:43
  /sys/devices/system/cpu/cpu18/acpi_cppc/wraparound_time:18446744073709551615
  /sys/devices/system/cpu/cpu19/acpi_cppc/feedback_ctrs:ref:33127087692 del:36493571195
  /sys/devices/system/cpu/cpu19/acpi_cppc/guaranteed_perf:21
  /sys/devices/system/cpu/cpu19/acpi_cppc/highest_perf:46
  /sys/devices/system/cpu/cpu19/acpi_cppc/lowest_freq:0
  /sys/devices/system/cpu/cpu19/acpi_cppc/lowest_nonlinear_perf:15
  /sys/devices/system/cpu/cpu19/acpi_cppc/lowest_perf:1
  /sys/devices/system/cpu/cpu19/acpi_cppc/nominal_freq:2100
  /sys/devices/system/cpu/cpu19/acpi_cppc/nominal_perf:29
  /sys/devices/system/cpu/cpu19/acpi_cppc/reference_perf:43
  /sys/devices/system/cpu/cpu19/acpi_cppc/wraparound_time:18446744073709551615
  /sys/devices/system/cpu/cpu1/acpi_cppc/feedback_ctrs:ref:47084742987 del:52088422560
  /sys/devices/system/cpu/cpu1/acpi_cppc/guaranteed_perf:32
  /sys/devices/system/cpu/cpu1/acpi_cppc/highest_perf:61
  /sys/devices/system/cpu/cpu1/acpi_cppc/lowest_freq:0
  /sys/devices/system/cpu/cpu1/acpi_cppc/lowest_nonlinear_perf:26
  /sys/devices/system/cpu/cpu1/acpi_cppc/lowest_perf:1
  /sys/devices/system/cpu/cpu1/acpi_cppc/nominal_freq:2700
  /sys/devices/system/cpu/cpu1/acpi_cppc/nominal_perf:43
  /sys/devices/system/cpu/cpu1/acpi_cppc/reference_perf:49
  /sys/devices/system/cpu/cpu1/acpi_cppc/wraparound_time:18446744073709551615
  /sys/devices/system/cpu/cpu20/acpi_cppc/feedback_ctrs:ref:35405865204 del:37891455176
  /sys/devices/system/cpu/cpu20/acpi_cppc/guaranteed_perf:21
  /sys/devices/system/cpu/cpu20/acpi_cppc/highest_perf:46
  /sys/devices/system/cpu/cpu20/acpi_cppc/lowest_freq:0
  /sys/devices/system/cpu/cpu20/acpi_cppc/lowest_nonlinear_perf:15
  /sys/devices/system/cpu/cpu20/acpi_cppc/lowest_perf:1
  /sys/devices/system/cpu/cpu20/acpi_cppc/nominal_freq:2100
  /sys/devices/system/cpu/cpu20/acpi_cppc/nominal_perf:29
  /sys/devices/system/cpu/cpu20/acpi_cppc/reference_perf:43
  /sys/devices/system/cpu/cpu20/acpi_cppc/wraparound_time:18446744073709551615
  /sys/devices/system/cpu/cpu21/acpi_cppc/feedback_ctrs:ref:31453151676 del:32354440344
  /sys/devices/system/cpu/cpu21/acpi_cppc/guaranteed_perf:21
  /sys/devices/system/cpu/cpu21/acpi_cppc/highest_perf:46
  /sys/devices/system/cpu/cpu21/acpi_cppc/lowest_freq:0
  /sys/devices/system/cpu/cpu21/acpi_cppc/lowest_nonlinear_perf:15
  /sys/devices/system/cpu/cpu21/acpi_cppc/lowest_perf:1
  /sys/devices/system/cpu/cpu21/acpi_cppc/nominal_freq:2100
  /sys/devices/system/cpu/cpu21/acpi_cppc/nominal_perf:29
  /sys/devices/system/cpu/cpu21/acpi_cppc/reference_perf:43
  /sys/devices/system/cpu/cpu21/acpi_cppc/wraparound_time:18446744073709551615
  /sys/devices/system/cpu/cpu22/acpi_cppc/feedback_ctrs:ref:29395705360 del:30249765611
  /sys/devices/system/cpu/cpu22/acpi_cppc/guaranteed_perf:21
  /sys/devices/system/cpu/cpu22/acpi_cppc/highest_perf:46
  /sys/devices/system/cpu/cpu22/acpi_cppc/lowest_freq:0
  /sys/devices/system/cpu/cpu22/acpi_cppc/lowest_nonlinear_perf:15
  /sys/devices/system/cpu/cpu22/acpi_cppc/lowest_perf:1
  /sys/devices/system/cpu/cpu22/acpi_cppc/nominal_freq:2100
  /sys/devices/system/cpu/cpu22/acpi_cppc/nominal_perf:29
  /sys/devices/system/cpu/cpu22/acpi_cppc/reference_perf:43
  /sys/devices/system/cpu/cpu22/acpi_cppc/wraparound_time:18446744073709551615
  /sys/devices/system/cpu/cpu23/acpi_cppc/feedback_ctrs:ref:34147115164 del:34129428131
  /sys/devices/system/cpu/cpu23/acpi_cppc/guaranteed_perf:21
  /sys/devices/system/cpu/cpu23/acpi_cppc/highest_perf:46
  /sys/devices/system/cpu/cpu23/acpi_cppc/lowest_freq:0
  /sys/devices/system/cpu/cpu23/acpi_cppc/lowest_nonlinear_perf:15
  /sys/devices/system/cpu/cpu23/acpi_cppc/lowest_perf:1
  /sys/devices/system/cpu/cpu23/acpi_cppc/nominal_freq:2100
  /sys/devices/system/cpu/cpu23/acpi_cppc/nominal_perf:29
  /sys/devices/system/cpu/cpu23/acpi_cppc/reference_perf:43
  /sys/devices/system/cpu/cpu23/acpi_cppc/wraparound_time:18446744073709551615
  /sys/devices/system/cpu/cpu2/acpi_cppc/feedback_ctrs:ref:52863482561 del:63458169943
  /sys/devices/system/cpu/cpu2/acpi_cppc/guaranteed_perf:32
  /sys/devices/system/cpu/cpu2/acpi_cppc/highest_perf:63
  /sys/devices/system/cpu/cpu2/acpi_cppc/lowest_freq:0
  /sys/devices/system/cpu/cpu2/acpi_cppc/lowest_nonlinear_perf:26
  /sys/devices/system/cpu/cpu2/acpi_cppc/lowest_perf:1
  /sys/devices/system/cpu/cpu2/acpi_cppc/nominal_freq:2700
  /sys/devices/system/cpu/cpu2/acpi_cppc/nominal_perf:43
  /sys/devices/system/cpu/cpu2/acpi_cppc/reference_perf:49
  /sys/devices/system/cpu/cpu2/acpi_cppc/wraparound_time:18446744073709551615
  /sys/devices/system/cpu/cpu3/acpi_cppc/feedback_ctrs:ref:53310134126 del:60839001140
  /sys/devices/system/cpu/cpu3/acpi_cppc/guaranteed_perf:32
  /sys/devices/system/cpu/cpu3/acpi_cppc/highest_perf:63
  /sys/devices/system/cpu/cpu3/acpi_cppc/lowest_freq:0
  /sys/devices/system/cpu/cpu3/acpi_cppc/lowest_nonlinear_perf:26
  /sys/devices/system/cpu/cpu3/acpi_cppc/lowest_perf:1
  /sys/devices/system/cpu/cpu3/acpi_cppc/nominal_freq:2700
  /sys/devices/system/cpu/cpu3/acpi_cppc/nominal_perf:43
  /sys/devices/system/cpu/cpu3/acpi_cppc/reference_perf:49
  /sys/devices/system/cpu/cpu3/acpi_cppc/wraparound_time:18446744073709551615
  /sys/devices/system/cpu/cpu4/acpi_cppc/feedback_ctrs:ref:37661765305 del:39273578265
  /sys/devices/system/cpu/cpu4/acpi_cppc/guaranteed_perf:32
  /sys/devices/system/cpu/cpu4/acpi_cppc/highest_perf:61
  /sys/devices/system/cpu/cpu4/acpi_cppc/lowest_freq:0
  /sys/devices/system/cpu/cpu4/acpi_cppc/lowest_nonlinear_perf:26
  /sys/devices/system/cpu/cpu4/acpi_cppc/lowest_perf:1
  /sys/devices/system/cpu/cpu4/acpi_cppc/nominal_freq:2700
  /sys/devices/system/cpu/cpu4/acpi_cppc/nominal_perf:43
  /sys/devices/system/cpu/cpu4/acpi_cppc/reference_perf:49
  /sys/devices/system/cpu/cpu4/acpi_cppc/wraparound_time:18446744073709551615
  /sys/devices/system/cpu/cpu5/acpi_cppc/feedback_ctrs:ref:37315012790 del:40229366158
  /sys/devices/system/cpu/cpu5/acpi_cppc/guaranteed_perf:32
  /sys/devices/system/cpu/cpu5/acpi_cppc/highest_perf:61
  /sys/devices/system/cpu/cpu5/acpi_cppc/lowest_freq:0
  /sys/devices/system/cpu/cpu5/acpi_cppc/lowest_nonlinear_perf:26
  /sys/devices/system/cpu/cpu5/acpi_cppc/lowest_perf:1
  /sys/devices/system/cpu/cpu5/acpi_cppc/nominal_freq:2700
  /sys/devices/system/cpu/cpu5/acpi_cppc/nominal_perf:43
  /sys/devices/system/cpu/cpu5/acpi_cppc/reference_perf:49
  /sys/devices/system/cpu/cpu5/acpi_cppc/wraparound_time:18446744073709551615
  /sys/devices/system/cpu/cpu6/acpi_cppc/feedback_ctrs:ref:31209054793 del:33190454758
  /sys/devices/system/cpu/cpu6/acpi_cppc/guaranteed_perf:32
  /sys/devices/system/cpu/cpu6/acpi_cppc/highest_perf:61
  /sys/devices/system/cpu/cpu6/acpi_cppc/lowest_freq:0
  /sys/devices/system/cpu/cpu6/acpi_cppc/lowest_nonlinear_perf:26
  /sys/devices/system/cpu/cpu6/acpi_cppc/lowest_perf:1
  /sys/devices/system/cpu/cpu6/acpi_cppc/nominal_freq:2700
  /sys/devices/system/cpu/cpu6/acpi_cppc/nominal_perf:43
  /sys/devices/system/cpu/cpu6/acpi_cppc/reference_perf:49
  /sys/devices/system/cpu/cpu6/acpi_cppc/wraparound_time:18446744073709551615
  /sys/devices/system/cpu/cpu7/acpi_cppc/feedback_ctrs:ref:27945691272 del:28942342249
  /sys/devices/system/cpu/cpu7/acpi_cppc/guaranteed_perf:32
  /sys/devices/system/cpu/cpu7/acpi_cppc/highest_perf:61
  /sys/devices/system/cpu/cpu7/acpi_cppc/lowest_freq:0
  /sys/devices/system/cpu/cpu7/acpi_cppc/lowest_nonlinear_perf:26
  /sys/devices/system/cpu/cpu7/acpi_cppc/lowest_perf:1
  /sys/devices/system/cpu/cpu7/acpi_cppc/nominal_freq:2700
  /sys/devices/system/cpu/cpu7/acpi_cppc/nominal_perf:43
  /sys/devices/system/cpu/cpu7/acpi_cppc/reference_perf:49
  /sys/devices/system/cpu/cpu7/acpi_cppc/wraparound_time:18446744073709551615
  /sys/devices/system/cpu/cpu8/acpi_cppc/feedback_ctrs:ref:30470288492 del:31360721157
  /sys/devices/system/cpu/cpu8/acpi_cppc/guaranteed_perf:21
  /sys/devices/system/cpu/cpu8/acpi_cppc/highest_perf:46
  /sys/devices/system/cpu/cpu8/acpi_cppc/lowest_freq:0
  /sys/devices/system/cpu/cpu8/acpi_cppc/lowest_nonlinear_perf:15
  /sys/devices/system/cpu/cpu8/acpi_cppc/lowest_perf:1
  /sys/devices/system/cpu/cpu8/acpi_cppc/nominal_freq:2100
  /sys/devices/system/cpu/cpu8/acpi_cppc/nominal_perf:29
  /sys/devices/system/cpu/cpu8/acpi_cppc/reference_perf:43
  /sys/devices/system/cpu/cpu8/acpi_cppc/wraparound_time:18446744073709551615
  /sys/devices/system/cpu/cpu9/acpi_cppc/feedback_ctrs:ref:33008945576 del:35214567794
  /sys/devices/system/cpu/cpu9/acpi_cppc/guaranteed_perf:21
  /sys/devices/system/cpu/cpu9/acpi_cppc/highest_perf:46
  /sys/devices/system/cpu/cpu9/acpi_cppc/lowest_freq:0
  /sys/devices/system/cpu/cpu9/acpi_cppc/lowest_nonlinear_perf:15
  /sys/devices/system/cpu/cpu9/acpi_cppc/lowest_perf:1
  /sys/devices/system/cpu/cpu9/acpi_cppc/nominal_freq:2100
  /sys/devices/system/cpu/cpu9/acpi_cppc/nominal_perf:29
  /sys/devices/system/cpu/cpu9/acpi_cppc/reference_perf:43
  /sys/devices/system/cpu/cpu9/acpi_cppc/wraparound_time:18446744073709551615

Thanks again,

--
Aaron

[-- Attachment #2: check-intel-cpu-freq --]
[-- Type: application/octet-stream, Size: 7254 bytes --]

#!/bin/bash

_echoMaxCoreFreqFn () {
  # shellcheck disable=SC2034
  declare _begin_int _end_int _msg _loop_idx _core_idx;
  _begin_int="${1:-}";
  _end_int="${2:-}";
  _msg="Sampling freq of cores |${_begin_int}..${_end_int}| 200 times ...";
  1>&2 echo "${_msg}";

  for (( _loop_idx = 0; _loop_idx < 200; _loop_idx++ )); do
    for (( _core_idx = _begin_int; _core_idx <= _end_int; _core_idx++ )); do
      _str="$(cat "${_freqDir}/policy${_core_idx}/scaling_cur_freq")";
      echo "${_str} ${_core_idx} ";
    done
    sleep 0.05;
  done |sort -rn |head -n1
}

_mainFn () {
  declare _report_str _report_list _noturbo_int _do_turbo \
    _core_type _core_dir _range_str _begin_int _end_int \
    _max_claim_core _max_claim_freq _base_claim_core \
    _base_claim_freq _idx _scratch_int _scratch_str _bit_list \
    _max_spec_freq _base_spec_freq _max_test_freq _max_test_core;

  echo; echo '== BEGIN ==';
  echo 'Report (P|E) (turbo|no-turbo) (max|base) frequencies'
  read -rp 'Start Geekbench 5 in a separate terminal and return here';
  _report_list=();

  ## Begin Loop through P and E core types
  for _core_type in 'P' 'E'; do
    # We read the core types per this spec:
    #   https://github.com/torvalds/linux/blob/master/ \
    #   tools/perf/Documentation/intel-hybrid.txt
    _core_dir='cpu_atom';
    [ "${_core_type}" = 'P' ] && _core_dir='cpu_core';
    _range_str="$(cat "${_eventDir}/${_core_dir}/cpus")";
    _begin_int="$(cut -f1 -d- <<< "${_range_str}")";
    _end_int="$(  cut -f2 -d- <<< "${_range_str}")";

    ## Begin Loop through turbo states (on, off)
    for _noturbo_int in '1' '0'; do
      _do_turbo='y';
      [ "${_noturbo_int}" = 1 ] && _do_turbo='n';
      echo "${_noturbo_int}" | 1>/dev/null sudo tee "${_noturboFile}" || true;
      sleep 1;
      if ! grep -q "${_noturbo_int}" "${_noturboFile}"; then
        echo "ABORT: Turbo is not set as expected |${_noturbo_int}|";
        return 1;
      fi

      # Determine intel-specified frequencies
      echo;
      if [ "${_core_type}" = 'P' ]; then
        _base_spec_freq="${_specPCoreBaseMax}";
        if [ "${_do_turbo}" = 'y' ]; then
          _max_spec_freq="${_specPCoreTurboMax}"; # 5400000
        else
          _max_spec_freq="${_specPCoreBaseMax}"; # 2700000
        fi
        echo 'Make sure GeekBench SINGLE core is running';
        read -rp '  then press [ Enter ]';
      else
        _base_spec_freq="${_specECoreBaseMax}";
        if [ "$_do_turbo" = 'y' ]; then
          _max_spec_freq="${_specECoreTurboMax}"; # 4600000
        else
          _max_spec_freq="${_specECoreBaseMax}"; # 2100000
        fi
        echo 'Make sure GeekBench MULTI core is running';
        read -rp '  then press [ Enter ]';
      fi

      ## Begin Loop through cores to find claimed
      #   max scaling and base freqs and corresponding cores
      _max_claim_core=0; _max_claim_freq=0; _base_claim_core=0; _base_claim_freq=0;
      for (( _idx = _begin_int; _idx <= _end_int; _idx++ )); do
        _scratch_int="$(cat "${_freqDir}/policy${_idx}/cpuinfo_max_freq")";
        if (( _scratch_int >= _max_claim_freq )); then
          _max_claim_freq="${_scratch_int}";
          _max_claim_core="${_idx}";
        fi
        _scratch_int="$(cat "${_freqDir}/policy${_idx}/base_frequency")";
        if (( _scratch_int >= _base_claim_freq )); then
          _base_claim_freq="${_scratch_int}";
          _base_claim_core="${_idx}";
        fi
      done
      ## . End Loop through cores to find

      # Set expected values
      echo; echo "Sample freq: Type |${_core_type}| Turbo |${_do_turbo^^}|";
      read -rp '  press [ Enter ] to take frequency samples... ';
      _scratch_str="$(_echoMaxCoreFreqFn "${_begin_int}" "${_end_int}")";
      IFS=' ' read -ra _bit_list <<< "${_scratch_str}";
      _max_test_freq="${_bit_list[0]}";
      _max_test_core="${_bit_list[1]}";

      # Report values from search
      [ "${_do_turbo}" = 'y' ] && _scratch_str='ON' || _scratch_str='off';
      _report_str="$(
        # shellcheck disable=SC2059
        printf "${_formatStr}" "${_core_type}" "${_scratch_str}" \
          "${_base_claim_freq}" "${_base_claim_core}" "${_base_spec_freq}" \
          "${_max_claim_freq}" "${_max_claim_core}" "${_max_spec_freq}" \
          "${_max_test_freq}"  "${_max_test_core}"
      )";
      _report_list+=("${_report_str}");
    done
    ## . End Loop through turbo states (on, off)
  done
  ## . End Loop through P and E core types

  echo; echo '== REPORT ==';
  echo "${_headerStr}";
  ( IFS=$'\n'; echo "${_report_list[*]}"; )

  echo;
  cat << 'EOF'
## Key

Column  | Values | Purpose
--------|--------|---------
Type    | P|E    | The subset of cores this row applied to.
        |        |   For example, `P` means `all P-cores`.
Turbo   | off|ON | The turbo setting of this core subset.
B-Claim | int Hz | The max `base_frequency` value of this core subset.
     Id | int    | The core id that provided the Base-Claim value.
B-Spec  | int Hz | Intel SPEC'D BASE freq for this CPU's core Type.
M-Claim | int Hz | The max `cpuinfo_max_freq` value of this core subset.
     Id | int    | The core id that provided the Max-Claim value.
M-Spec  | int Hz | Intel SPEC'D MAX freq for this CPU's core Type.
M-Test  | int Hz | The max `scaling_cur_freq` value of this core subset.
        |        |   The entire core subset is sampled 200x.
     Id | int    | The core id that provided the Max-Test value.

EOF
  echo '== END   =='; echo;
}

declare _eventDir _cpuDir _freqDir _noturboFile \
  _headerStr _formatStr _cpuId _specPCoreTurboMax _bitList \
  _specECoreTurboMax _specPCoreBaseMax _specECoreBaseMax;
declare -A _specMatrix;

# Get specs for CPUs from a page like this for the 'Ultra 9 275HX':
#   https://www.intel.com/content/www/us/en/products/sku/242293/intel-core
#   -ultra-9-processor-275hx-36m-cache-up-to-5-40-ghz/specifications.html
_specMatrix=(
  # CPU Name;P-turbo-max;E-turbo-max;P-base;E-base
  ['Intel Core Ultra 9 275HX']='5400000;4600000;2700000;2100000'
  ['Intel Core Ultra 7 255H']='5100000;4400000;2000000;1500000'
  ['Intel Core Ultra 5 225H']='4900000;4300000;1700000;1300000'
  ['Intel Core i9-14900HX']='5800000;4100000;2200000;1600000'
);
_cpuId="$(
  lscpu \
    | grep 'Model name:' \
    | grep -v 'BIOS Model name:' \
    | awk -F':' '{ print $2 }' \
    | sed 's/^ *//; s/(\(R\|TM\))//g'
)";
_specLine="${_specMatrix["${_cpuId}"]}";
if [ -z "${_specLine:-}" ]; then
  echo "ABORT: Cannot find processor |${_cpuId}| specs!";
  echo "  Please get the specs from Intel and add to the _specMatrix."
  exit 1;
fi
IFS=';' read -ra _bitList <<< "${_specLine}";
_specPCoreTurboMax="${_bitList[0]}";
_specECoreTurboMax="${_bitList[1]}";
_specPCoreBaseMax="${_bitList[2]}";
_specECoreBaseMax="${_bitList[3]}";

_eventDir='/sys/bus/event_source/devices';
_cpuDir='/sys/devices/system/cpu';
_freqDir="${_cpuDir}/cpufreq";
_noturboFile="${_cpuDir}/intel_pstate/no_turbo";
_headerStr="$(cat << EOF
CPU: ${_cpuId}
Type | Turbo | B-Claim . Id | B-Spec  | M-Claim . Id | M-Spec  | M-Test  . Id
-----| ----- | ------------ | ------- | ------------ |-------- | ------------
EOF
)";
_formatStr="$(cat <<'EOF'
%-4s | %-5s | %06d . %02d | %06d | %06d . %02d | %06d | %06d . %02d
EOF
)";

_mainFn;

  parent reply	other threads:[~2025-12-15  0:45 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-18  3:33 [BUG] intel_pstate: CPU frequencies miscalculated/incorrectly detected on Arrow Lake hardware Aaron Rainbolt
2025-05-19 12:48 ` srinivas pandruvada
2025-11-06 19:46   ` Aaron Rainbolt
2025-07-22 16:31 ` Aaron Rainbolt
2025-07-22 17:24   ` srinivas pandruvada
2025-11-26 23:00     ` Aaron Rainbolt
2025-12-03 17:38       ` Aaron Rainbolt
2025-12-05 19:10         ` srinivas pandruvada
2025-12-05 19:28           ` Rafael J. Wysocki
2025-12-05 19:50             ` srinivas pandruvada
2025-12-05 20:04               ` Rafael J. Wysocki
2025-12-15  0:45           ` Aaron Rainbolt [this message]
2025-12-15 14:16             ` srinivas pandruvada
2025-12-15 15:25               ` Aaron Rainbolt
2025-12-17 13:33                 ` srinivas pandruvada
2025-12-23 17:41                   ` Aaron Rainbolt
2025-12-23 19:21                     ` srinivas pandruvada
2026-01-11  4:53 ` Russell Haley
2026-01-26 16:14   ` Aaron Rainbolt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251214184507.21f95134@kf-m2g5 \
    --to=arainbolt@kfocus.org \
    --cc=kernel-team@lists.ubuntu.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mmikowski@kfocus.org \
    --cc=rjw@rjwysocki.net \
    --cc=srinivas.pandruvada@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox