You are not logged in.

#1 2025-08-26 04:29:48

hevin
Member
Registered: 2021-08-14
Posts: 63

CPU Frequency Control

hi.
i have new hardware. 12400 on msi 7D90
and.... it's works only on 800MHz.
I installed cpupower. tried to set the frequency. with cpupower cpupower frequency-set -f  2500Mhz and cpupower frequency-set --min  2500Mhz  This changed the behavior, cpu cores have become more frequent and longer to be in a state of 2500Mhz. but not all core always works on 2500MHz.  tried to fix the frequencies in the BIOS and turn off speedstep and speedshift. but no effect. in windows 10 or windows 11 it's works.
What should I do to ensure that my processor never lowers frequencies below 2.5GHz

Offline

#2 2025-08-26 07:05:25

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 72,920

Re: CPU Frequency Control

https://bbs.archlinux.org/viewtopic.php … 1#p2258541
See https://wiki.archlinux.org/title/CPU_frequency_scaling and post the output of "lscpu" and WITHOUT enforcing any frequency,

cpupower frequency-info

All of that after ensuring that windows is not in (secret) hibernation.

Offline

#3 2025-08-26 19:40:16

hevin
Member
Registered: 2021-08-14
Posts: 63

Re: CPU Frequency Control

lscpu

lscpu
Architecture:                x86_64
  CPU op-mode(s):            32-bit, 64-bit
  Address sizes:             39 bits physical, 48 bits virtual
  Byte Order:                Little Endian
CPU(s):                      12
  On-line CPU(s) list:       0-11
Vendor ID:                   GenuineIntel
  Model name:                12th Gen Intel(R) Core(TM) i5-12400
    CPU family:              6
    Model:                   151
    Thread(s) per core:      2
    Core(s) per socket:      6
    Socket(s):               1
    Stepping:                5
    CPU(s) scaling MHz:      14%
    CPU max MHz:             5600.0000
    CPU min MHz:             800.0000
    BogoMIPS:                4992.00
    Flags:                   fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs
                              bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe
                             popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_adjus
                             t bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt clwb intel_pt sha_ni xsaveopt xsavec xgetbv1 xsaves split_lock_detect user_shstk avx_vnni dtherm ida arat pln pts hwp hwp
                             _notify hwp_act_window hwp_epp hwp_pkg_req hfi vnmi umip pku ospke waitpkg gfni vaes vpclmulqdq rdpid movdiri movdir64b fsrm md_clear serialize arch_lbr ibt flush_l1d arch_capabilitie
                             s
Virtualization features:
  Virtualization:            VT-x
cpupower frequency-info
analyzing CPU 0:
  driver: intel_pstate
  CPUs which run at the same hardware frequency: 0
  CPUs which need to have their frequency coordinated by software: 0
  energy performance preference: balance_performance
  hardware limits: 800 MHz - 5.60 GHz
  available cpufreq governors: performance powersave
  current policy: frequency should be within 800 MHz and 5.60 GHz.
                  The governor "powersave" may decide which speed to use
                  within this range.
  current CPU frequency: 800 MHz (asserted by call to kernel)
  boost state support:
    Supported: yes
    Active: yes

Last edited by hevin (2025-08-26 21:17:20)

Offline

#4 2025-08-26 19:41:28

hevin
Member
Registered: 2021-08-14
Posts: 63

Re: CPU Frequency Control

.

Last edited by hevin (2025-08-26 21:17:39)

Offline

#5 2025-08-26 20:06:50

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 72,920

Re: CPU Frequency Control

Please use [code][/code] tags. Edit your post in this regard.
Also don't bump, edit your previous post to mend it if nobody has yet replied.

  current policy: frequency should be within 800 MHz and 5.60 GHz.
                  The governor "powersave" may decide which speed to use
                  within this range.

So what happens when you select the performance governor?

Offline

#6 2025-08-26 21:24:36

hevin
Member
Registered: 2021-08-14
Posts: 63

Re: CPU Frequency Control

[root@archlinux ~]# cpupower frequency-set -g performance
Setting cpu: 0
Setting cpu: 1
Setting cpu: 2
Setting cpu: 3
Setting cpu: 4
Setting cpu: 5
Setting cpu: 6
Setting cpu: 7
Setting cpu: 8
Setting cpu: 9
Setting cpu: 10
Setting cpu: 11

[root@archlinux ~]# cpupower frequency-set -g userspace
Setting cpu: 0
Error setting new values. Common errors:
- Do you have proper administration rights? (super-user?)
- Is the governor you requested available and modprobed?
- Trying to set an invalid policy?
- Trying to set a specific frequency, but userspace governor is not available,
   for example because of hardware which cannot be set to a specific frequency
   or because the userspace governor isn't loaded?
cpupower frequency-set -g userspace
Setting cpu: 0
Error setting new values. Common errors:
- Do you have proper administration rights? (super-user?)
- Is the governor you requested available and modprobed?
- Trying to set an invalid policy?
- Trying to set a specific frequency, but userspace governor is not available,
   for example because of hardware which cannot be set to a specific frequency
   or because the userspace governor isn't loaded?
[root@archlinux ~]# cpupower -
-c         --cpu      -v         --version
[root@archlinux ~]# cpupower
-c              --cpu           frequency-info  frequency-set   help            idle-info       idle-set        info            monitor         set             -v              --version
[root@archlinux ~]# cpupower frequency-set -f 4000MHz
Setting cpu: 0
Error setting new values. Common errors:
- Do you have proper administration rights? (super-user?)
- Is the governor you requested available and modprobed?
- Trying to set an invalid policy?
- Trying to set a specific frequency, but userspace governor is not available,
   for example because of hardware which cannot be set to a specific frequency
   or because the userspace governor isn't loaded?

Offline

#7 2025-08-26 21:36:46

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 72,920

Re: CPU Frequency Control

cpupower frequency-set -g userspace

what's that supposed to do?
The question is whether the CPU starts to tick up if you challenge it a bit, eg. using https://wiki.archlinux.org/title/Stress_testing#stress

Offline

#8 2025-08-26 21:50:20

hevin
Member
Registered: 2021-08-14
Posts: 63

Re: CPU Frequency Control

.

Last edited by hevin (2025-08-26 22:06:47)

Offline

#9 2025-08-26 22:01:40

hevin
Member
Registered: 2021-08-14
Posts: 63

Re: CPU Frequency Control

screenshot.png

screenshot2.png

seth wrote:

cpupower frequency-set -g userspace

what's that supposed to do?
The question is whether the CPU starts to tick up if you challenge it a bit, eg. using https://wiki.archlinux.org/title/Stress_testing#stress

This is necessary to install the governor userspace, which is required for manual frequency control( cpupower frequency-set -f ). With governor performance and power, the frequency changes dynamically depending on the load from 800 to 4000.And I need that the frequency was 2500 and did not change depending on the load. or from 2500 to 4400.

Last edited by hevin (2025-08-26 22:06:09)

Offline

#10 2025-08-26 22:05:32

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 72,920

Re: CPU Frequency Control

See the liked wiki again, the userpsace governor isn't available w/ the intel_pstate driver, try https://wiki.archlinux.org/title/CPU_fr … requencies or switch to acpi_cpufreq by disabling intel_pstate

Offline

#11 2025-08-26 22:13:34

hevin
Member
Registered: 2021-08-14
Posts: 63

Re: CPU Frequency Control

and what about

x86_energy_perf_policy supports configuration of EPP hints via the --hwp-epp switch on Intel CPUs only. It works via direct access of machine-specific registers (MSRs) which differ between Intel and AMD. The program can also restrict the range of HWP frequencies using a range of frequency multipliers

Offline

#12 2025-08-26 22:36:34

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 72,920

Re: CPU Frequency Control

What about that?
Idk why you

need that the frequency was 2500 and did not change depending on the load

but https://man.archlinux.org/man/x86_energy_perf_policy.8 allows you to tune the performance levels, which you're not particularly interested in and then I'd stay away from the MSR?

Offline

#13 2025-08-27 02:17:49

hevin
Member
Registered: 2021-08-14
Posts: 63

Re: CPU Frequency Control

i add kernel option intel_pstate=disable
and now my frequency-info

cpupower frequency-info
analyzing CPU 8:
  driver: acpi-cpufreq
  CPUs which run at the same hardware frequency: 8
  CPUs which need to have their frequency coordinated by software: 8
  maximum transition latency: 10.0 us
  hardware limits: 800 MHz - 2.50 GHz
  available frequency steps:  2.50 GHz, 2.50 GHz, 2.40 GHz, 2.30 GHz, 2.20 GHz, 2.10 GHz, 2.00 GHz, 1.90 GHz, 1.80 GHz, 1.70 GHz, 1.60 GHz, 1.50 GHz, 1.40 GHz, 1.30 GHz, 1.20 GHz, 1.10 GHz, 1000 MHz, 900 MHz, 800 MHz
  available cpufreq governors: conservative ondemand userspace powersave performance schedutil
  current policy: frequency should be within 800 MHz and 2.50 GHz.
                  The governor "schedutil" may decide which speed to use
                  within this range.
  current CPU frequency: 3.57 GHz (asserted by call to kernel)
  boost state support:
    Supported: yes
    Active: yes

then i frequency-set -f 2500MHz

sudo cpupower frequency-set -f 2500MHz
Setting cpu: 0
Setting cpu: 1
Setting cpu: 2
Setting cpu: 3
Setting cpu: 4
Setting cpu: 5
Setting cpu: 6
Setting cpu: 7
Setting cpu: 8
Setting cpu: 9
Setting cpu: 10
Setting cpu: 11
[root@archlinux ~]# cpupower frequency-set -g userspace
Setting cpu: 0
Setting cpu: 1
Setting cpu: 2
Setting cpu: 3
Setting cpu: 4
Setting cpu: 5
Setting cpu: 6
Setting cpu: 7
Setting cpu: 8
Setting cpu: 9
Setting cpu: 10
Setting cpu: 11
[root@archlinux ~]# htop
[root@archlinux ~]# cpupower frequency-set -f 2500MHz
Setting cpu: 0
Setting cpu: 1
Setting cpu: 2
Setting cpu: 3
Setting cpu: 4
Setting cpu: 5
Setting cpu: 6
Setting cpu: 7
Setting cpu: 8
Setting cpu: 9
Setting cpu: 10
Setting cpu: 11

but it doesn't work. frequency drops below 2500MHz on random core
screenshot3.png
also i try cpupower frequency-set -f 3500MHz, cpupower frequency-set -f 4500MHz, cpupower frequency-set -f 1500MHz and It has absolutely no effect. htop shows the same as screeshot/

on lite load i.e youtube, frequency are lower then idle/
screenshot3.png

Last edited by hevin (2025-08-27 02:30:04)

Offline

#14 2025-08-27 07:12:18

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 72,920

Re: CPU Frequency Control

cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_setspeed

i try cpupower frequency-set -f 3500MHz, cpupower frequency-set -f 4500MHz, cpupower frequency-set -f 1500MHz and It has absolutely no effect

available frequency steps:  2.50 GHz, 2.50 GHz, 2.40 GHz, 2.30 GHz, 2.20 GHz, 2.10 GHz, 2.00 GHz, 1.90 GHz, 1.80 GHz, 1.70 GHz, 1.60 GHz, 1.50 GHz, 1.40 GHz, 1.30 GHz, 1.20 GHz, 1.10 GHz, 1000 MHz, 900 MHz, 800 MHz

1. why are you not just setting the limits
2. your cpu clearly steps up in various contexts, it runs at 800MHz because there's nothing to do. Since this has all the hallmarks of an https://en.wikipedia.org/wiki/XY_problem - what are you *ACTUALLY* trying to achieve here? Wtf to you want to lock in the CPU at 2500MHz?
Windows runs the CPU at higher frequencies because of some random background daemons wasting CPU cycles *and battery* - that does not mean "it's running faster" - on the contrary, constantly running the CPU at higher frequencies will heat it up and ramp up the fans until it has to limit the clock rate to stay inside the TDP where the intel_pstate governor will allow you to boost a single core to 5.6GHz to increase single thread performance.

Offline

#15 2025-08-27 07:51:38

hevin
Member
Registered: 2021-08-14
Posts: 63

Re: CPU Frequency Control

1. what limits and how set it?

2. in linux setting fixed cpu frequency is a problem?
in windows, i can fixed frequency in bios, and task manager or hwinfo shows that all cores runs at this frequency independently of load. or i can change speedshift and set dynamyc frequency but in custom range. or i can change core parking mode and windows dynamicly disable 4 or 2 core. what is analog in llinux?
it's  ring frequency, that depending on core frequency, and ram speed depending of ring frequency, and iGPU uses system ram with lower speed because cpu power saving. it's a desktop pc not a shitbook, i have unlimited power electrical network, no battary, huge tower cpu cooler, there is no reason to any "power saving" . i disable any tdp limits, power saving, enhached intel speed shit, in bios. and works in windows, but linux change all setting to default powersaving with 800MHZ.
my 4 display takes more power then cpu saving, while we waiting growing up cpu frequency big_smile

root@archlinux ~]# cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_setspeed
2500000
2500000
2500000
2500000
2500000
2500000
2500000
2500000
2500000
2500000
2500000
2500000

Last edited by hevin (2025-08-27 17:11:43)

Offline

#16 2025-08-27 07:59:55

hevin
Member
Registered: 2021-08-14
Posts: 63

Re: CPU Frequency Control

.

Last edited by hevin (2025-08-27 17:11:34)

Offline

#17 2025-08-27 08:08:19

hevin
Member
Registered: 2021-08-14
Posts: 63

Re: CPU Frequency Control

.

Last edited by hevin (2025-08-27 17:11:14)

Offline

#18 2025-08-27 14:28:41

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 72,920

Re: CPU Frequency Control

Does https://deepl.com/ speak your native language?
Also please don't bump, edit you previous post to mend it if nobody has yet replied to not simulate action on the thread.

scaling_setspeed suggests all cores are at 2500GHz - also iff you'd lock the CPU in the UEFI that'd happen across all OS and you cannot "disable any tdp limits", https://en.wikipedia.org/wiki/Thermal_design_power
I also severely doubt that the RAM clock is tied to the speed stepping of the CPU in any way shape or form, where did you get that idea?

Offline

#19 2025-08-27 17:04:55

hevin
Member
Registered: 2021-08-14
Posts: 63

Re: CPU Frequency Control

seth wrote:

scaling_setspeed suggests all cores are at 2500GHz

However, monitoring shows that the frequency drops on some cores.
/sys/devices/system/cpu/cpu*/cpufreq/scaling_setspeed
What is this? Driver settings?
My processor cannot operate at a fixed base frequency? Am I asking for the impossible? Or is it broken? Or does Linux not know how to control the processor frequency?
From what I can see, the processor frequency is operating according to its own rules. The settings I make do not change anything. Why?
I disabled it in the BIOS. Speestep Speedshift C-state C1estate Turbo Boost, set fixed CPU ratio 35.

cpupower frequency-info
analyzing CPU 4:
  no or unknown cpufreq driver is active on this CPU
  CPUs which run at the same hardware frequency: Not Available
  CPUs which need to have their frequency coordinated by software: Not Available
  maximum transition latency:  Cannot determine or is not supported.
Not Available
  available cpufreq governors: Not Available
  Unable to determine current policy
  current CPU frequency:  Unable to call to kernel
  boost state support:
    Supported: yes
    Active: yes

htop shows the same thing as in the previous screenshots. 2500MHz with random drops on some cores below 2500.
2500 is its base frequency according to the specifications. It must operate at that frequency.

Our conversation is starting to drift off into some side discussions. There is no XYZ problem here. I just want all cores to always run at 2500 and nothing else. Or at 2500 and above, but the core frequency should NEVER drop below 2500. That's the only problem. Nothing else.
Has my English improved with deepl.com? But I think that even with my broken native English, you understood me.

I booted into WinPE with identical BIOS settings. See for yourself what the frequencies and load on the cores are in Windows. In Arch Linux with the same BIOS settings.
Speestep Speedshift C-state C1estate Turbo Boost, set fixed CPU ratio 35.
screenshot4.png
Capture.jpg

Last edited by hevin (2025-08-27 18:15:59)

Offline

#20 2025-09-02 14:25:37

marcoe
Member
Registered: 2025-08-30
Posts: 10

Re: CPU Frequency Control

CPU frequency should be measured with a full package workload (on all cores), because Linux employs a 20ms back-off if there are no jobs running on a CPU. This is to avoid sending IPIs (inter-processor interrupts) as reading MSR registers to query the current frequency requires scheduling a worker on the CPU you want to read the frequency from. If no job was running on the CPU for more than 20ms the kernel will query the currently registered policy that is driver/governor *AND* CPU specific (if I understand the code correctly) and this is most likely the reason you've observed the 800MHz value despite the frequency being set to 2500MHz.

Your images do not load for me and I'm late to the thread, but you've mentioned monitoring the current frequency in htop (which uses the mechanism I described above). If you want the actual hardware reported duty cycle of the processor you have to read the MSR registers yourself and multiply by the measured processor TSC (you can use the kernel value). If you are OK with a little bit of inaccuracy here's a python script that does this on the first CPU (CPU 0):

#!/usr/bin/python3 -S

import subprocess
import sys
import time

TSC = 3200

f_max = last_aperf = last_mperf = 0
f_min = 1 << 31
while True:
    with subprocess.Popen(
        ('/usr/bin/rdmsr', '--processor', '0', '--decimal', '0xE8H'),
        stdout=subprocess.PIPE,
        stderr=subprocess.DEVNULL,
        encoding='UTF-8'
    ) as p:
        aperf_str, _ = p.communicate()
    with subprocess.Popen(
        ('/usr/bin/rdmsr', '--processor', '0', '--decimal', '0xE7H'),
        stdout=subprocess.PIPE,
        stderr=subprocess.DEVNULL,
        encoding='UTF-8'
    ) as p:
        mperf_str, _ = p.communicate()

    aperf = int(aperf_str)
    mperf = int(mperf_str)

    acnt = aperf - last_aperf
    mcnt = mperf - last_mperf

    last_aperf = aperf
    last_mperf = mperf

    r = acnt / mcnt * TSC
    f_max = max(f_max, r)
    f_min = min(f_min, r)

    sys.stdout.write(f'MIN {f_min:.2f}  MAX {f_max:.2f}  RATIO {r:.2f}\n')
    time.sleep(0.25)

To run it:
First, query the TSC:

journalctl -b | grep tsc:

You will get something like this in the output, paste the `Detected` TSC value into the `TSC` variable in the script.

kernel: tsc: Detected 3200.000 MHz processor
kernel: tsc: Detected 3199.980 MHz TSC
kernel: tsc: Refined TSC clocksource calibration: 3191.999 MHz
kernel: clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x2e02c398820, max_idle_ns: 440795273435 ns

Install the `msr-tools` package:

pacman -S msr-tools

Make the script executable and run as root:

chmod +x script.py && sudo ./script.py

The output WILL be inaccurate (but accurate enough for you to observe that the frequency doesn't change) because it is written in Python and forks+execs an external program and this program additionally has to be preempted by the kernel immediately after execing on the specified CPU (in this case CPU 0).

Also, if your system is particularly busy and the readings are really inaccurate.
You can use this script to isolate a bunch of CPUs with cgroups:

#!/bin/bash

set -eu

AFFINITY="$1"

sudo systemctl set-property --runtime user.slice AllowedCPUs="$AFFINITY"
sudo systemctl set-property --runtime system.slice AllowedCPUs="$AFFINITY"

Use it like this to isolate the first CPU (CPU 0):

./usecpus.sh 1-11

And to return back to using all your cores:

./usecpus.sh 0-11

If you want more accuracy you will need a C program to do this directly (and also isolate the IRQs). And if you want to be really sure the readings are accurate, use a kernel module to do the work. I particularly like this project: https://github.com/cyring/CoreFreq

When it comes to Windows reporting the "correct" frequency. God knows what it does, but I presume it hammers the CPU with IPIs all day long - cloud providers wouldn't be happy about it though wink

Last edited by marcoe (2025-09-02 14:34:36)

Offline

#21 2025-09-04 07:55:32

hevin
Member
Registered: 2021-08-14
Posts: 63

Re: CPU Frequency Control

I discovered another problem. My processor is an Intel i5 12400, which has turbo boost. The boost value depends on the number of cores. For all 6 cores, it is 4000. And this works in Linux. But under a load of 2, the frequency should be 4400, and under a load of 4, it should be 4200. And this does not work. I experimented with xmring, but in any case, the frequency does not exceed 4000.

Offline

Board footer

Powered by FluxBB