You are not logged in.

#1 2025-03-02 18:17:00

Zibi1981
Member
From: Poland
Registered: 2008-01-31
Posts: 717

Kernel intel_pstate driver sets wrong core frequencies?

Why intel_pstate driver wrongly sets maximum frequencies of the P-cores of my CPU?

My CPU is a mobile Intel Core i9-13980HX (13th gen. Raptor Lake) which has the following capabilities when it comes to max frequencies

Frequency:	2.2 GHz
Turbo Clock:	up to 5.6 GHz
P-Core Boost 3.0:	5.5 GHz
E-Core Frequency:	1600 MHz up to 4 GHz

According to Intel XTU application and laptop's manufacturer (MSI) when Turbo Boost is enabled:
* 2 out of 8 P-cores (CPU 2 and CPU 3/CPU 4-5 and CPU 6-7 when hyper-threading is enabled) are capable of reaching up to 5,6Ghz
* the rest 6 out of 8 P-cores can go up to 5,2Ghz
* 16 E-cores can go up to 4,0Ghz

20250302-191848859-2.jpg

And this is what I get

cpu.png

CPUs from 0 to 3 and 8 to 15 should reach max 5,2GHz.

Additional info

sudo cat /proc/cpuinfo | grep microcode | sort | uniq
[sudo] hasło użytkownika cardiozibi: 
microcode       : 0x12c

6.13.5-2-cachyos #1 SMP PREEMPT_DYNAMIC Thu, 27 Feb 2025 20:01:00 +0000 x86_64 GNU/Linux

As one can see I'm currently under CachyOS kernel as it seems best for my gaming experience, but the same thing was under "standard" Arch and zen kernels.

Last edited by Zibi1981 (2025-03-03 22:02:11)


"... being a Linux user is sort of like living in a house inhabited by a large family of carpenters and architects. Every morning when you wake up, the house is a little different. Maybe there is a new turret, or some walls have moved. Or perhaps someone has temporarily removed the floor under your bed."

MSI Raider GE78HX 13VI-032PL

Offline

#2 2025-03-02 19:44:39

Zibi1981
Member
From: Poland
Registered: 2008-01-31
Posts: 717

Re: Kernel intel_pstate driver sets wrong core frequencies?

I think I'm able to correct that with this set of commands from comment No 6 of this particular Linux kernel bug discussion

❯ sudo cpupower -c 0-3 frequency-set -d 2.2GHz -u 5.2GHz
[sudo] hasło użytkownika cardiozibi: 
Setting cpu: 0
Setting cpu: 1
Setting cpu: 2
Setting cpu: 3

~
❯ sudo cpupower -c 4-7 frequency-set -d 2.2GHz -u 5.6GHz
Setting cpu: 4
Setting cpu: 5
Setting cpu: 6
Setting cpu: 7

~
❯ sudo cpupower -c 8-15 frequency-set -d 2.2GHz -u 5.2GHz
Setting cpu: 8
Setting cpu: 9
Setting cpu: 10
Setting cpu: 11
Setting cpu: 12
Setting cpu: 13
Setting cpu: 14
Setting cpu: 15

I will have to perform some tests if it works as it should be, that is stable and efficient.

Last edited by Zibi1981 (2025-03-02 19:45:16)


"... being a Linux user is sort of like living in a house inhabited by a large family of carpenters and architects. Every morning when you wake up, the house is a little different. Maybe there is a new turret, or some walls have moved. Or perhaps someone has temporarily removed the floor under your bed."

MSI Raider GE78HX 13VI-032PL

Offline

#3 Today 09:38:41

Zibi1981
Member
From: Poland
Registered: 2008-01-31
Posts: 717

Re: Kernel intel_pstate driver sets wrong core frequencies?

After a couple of days and doing some tests now I know that:

1) The above commands works but CPU still behaves unstable in some applications/situations.

2) The instability issue can be easily resolved by limiting max frequency to all P-cores to 5,4Ghz with simple command

sudo cpupower frequency-set -u 5400000

3) Now the issue is to make it permanent - modyfing /etc/default/cpupower

# Limit frequency range
# Valid suffixes: Hz, kHz (default), MHz, GHz, THz
min_freq="0.80GHz"
max_freq="5.4GHz"

and enabling cpupower.service

● cpupower.service - Apply cpupower configuration
     Loaded: loaded (/usr/lib/systemd/system/cpupower.service; enabled; preset: disabled)
     Active: active (exited) since Sun 2025-03-09 09:19:31 CET; 39s ago
 Invocation: 3c19902ea7f94bb5a7b78be1e1f85969
    Process: 2542 ExecStart=/usr/lib/systemd/scripts/cpupower (code=exited, status=0/SUCCESS)
   Main PID: 2542 (code=exited, status=0/SUCCESS)
   Mem peak: 2M
        CPU: 14ms

mar 09 09:19:31 Starting Apply cpupower configuration...
mar 09 09:19:31 Finished Apply cpupower configuration.

doesn't work as expected, because cpupower.service does not set the proper max frequencies automatically after every reboot, although it does so when I restart it manually after login-in, and the values are still being reset after some time. What could be the possible reason for that behaviour?

Last edited by Zibi1981 (Today 09:39:17)


"... being a Linux user is sort of like living in a house inhabited by a large family of carpenters and architects. Every morning when you wake up, the house is a little different. Maybe there is a new turret, or some walls have moved. Or perhaps someone has temporarily removed the floor under your bed."

MSI Raider GE78HX 13VI-032PL

Offline

Board footer

Powered by FluxBB