Is there a way to limit CPU core specific frequencies through software?

but only if somebody changed them, you said you're unable to change them because there is no option in BIOS so how the heck did they change?
I don't think anybody changed them. I think because of physical changes in the CPU over time, it might just need a bit more voltage to be stable. And not only my firmware doesn't have option to change voltages, it also locked the voltage control so any program cannot change the voltages.

can't give any suggestions
I don't want to be rude, but I never asked for suggestions in the first place. You still haven't even mentioned about changing CPU frequencies of specific cores, which is the question I asked. It's okay if you don't know about it, but then just tell.

hardware problem almost for sure.
Almost? Look, that is why I refused to talk about troubleshooting, because there is only so much people over the internet can provide, while I with nice tech knowledge, in front of my machine can do a lot more. You don't have a lot of context about the problem, and hence you are stating "almost" here. And if I starting giving you all the context, it will be much, much slower to troubleshoot. And just to let you know, it is 100% a hardware problem, and in the CPU itself. There is still a slight chance that it is a motherboard issue, in which I can't do much.
 


I don't want to be rude, but I never asked for suggestions in the first place. You still haven't even mentioned about changing CPU frequencies of specific cores, which is the question I asked. It's okay if you don't know about it, but then just tell.
Yeah I don't know what's the problem without having a closer look, I hope you fix your problem soon.

It's a big difference when I fix my own PC which I have physically vs when I help someone over the board.
There is not a single issue that I wasn't able to solve but only with my own computer, over forums it's much more difficult to help others, that's why a questioner needs to provide as much information as possible.
 
Kindly make a habit of taking the effort to read the only few messages discussed on the thread :).
The adjustment of voltage and frequency in relation to the temperature and CPU load is generally part of a regulation system where frequency is lowered when the temperature is too high (to reduce dynamic power dissipation) or when the computer is not used (to save energy). With slower frequency, it may be possible to lower the voltage (to save energy, reduce dissipation) as the transistors don't need to be as fast.
I did read
 
@CaffeineAddict @GatorsFan

But do you people have any idea how I can reduce the clock speed through software means?

I should share this update as well. So I just did some testing, and now, there is clear evidence that the third core has a problem. In Linux, if bring the CPUs 2 and 6 (third core and its hyperthread) offline, and unlock the frequency of the remaining 3 cores, then the system literally doesn't crash at all. And then say, if I offline the 4th core and its hyperthread, and bring the 3rd core and its HT online, with all CPUs still at max frequency, the system crashes quickly.

At boot, if I use the isolcpus kernel parameter, and isolate all the other CPUs except 2 and 6, the system has a very hard time trying to boot. Just crashes upon crashes.

And then I just found another trick which can reduce the performance loss needed even more. Look, the CPU has a defect or a degradation. It just cannot handle the 3.6 on all 8 CPUs. Performance loss is mandatory. But, this is the least performance loss needed method that I have found till now.
Just disable the hyperthread of the third core, which increase stability quite a bit. This way, I got 3.5 GHz on all the 7 CPUs. Losing only one hyperthread for 400-500 MHz seems worth it. And even better, if I use another idea that I recently found, of disabling CPU idling and running in constant C0 state, which increase stability even more, I might be able to run at 3.6GHz on the 7 CPUs, but I haven't tried yet.

This clearly shows that the third core is having problems. And it is not defective, it is just degraded. If only I succeed in getting voltage controls, which might solve the issue.

Now, what all I want is a way to limit the clock speed of the third core, and runs others at max. I tried to do it through MSR way. I tried to write to the 0x1AD register, which is the MSR_TURBO_RATIO_LIMIT register, but the value doesn't apply at all. That was to be expected as Throttlestop on Windows also cannot change the turbo ratios. On my other laptop, Throttlestop can change the turbo ratios, and so, I can also modify the 0x1AD register in Linux.

So the only way remains is software method. I mean, how difficult is it for the kernel to inject a few hundred million NOP instructions every second on a given CPU thread? That seems completely do-able. But, I think that might actually not work, as I also tried one thing where I used isolcpus and isolated the 2 and 6 CPUs, instead of putting them to offline at runtime, and the system still crashed. So I think hardware level changes are needed, but it is still worth a shot.
 
You can try cpufrequtils - it is available in the Debian repos through Synaptic
Oh come on, I have tried all of these tools. Like all of them. That is why by "software", I didn't mean programs like this, but -
for the kernel to inject a few hundred million NOP instructions every second on a given CPU thread?
In easier words, maybe limiting the total CPU usage on that specific CPU thread?
 
That is why by "software", I didn't mean programs like this,

Huh? Programs are software.
=================================================================
There is no GUI application to do this, if that's what you mean. However, you can do it from the command line.

Limiting Frequency for All Cores:
To set the maximum clock frequency (in GHz or MHz), use:
sudo cpupower frequency-set -u clock_freq

To set the minimum clock frequency:
sudo cpupower frequency-set -d clock_freq

To set the CPU to run at a specific frequency:
sudo cpupower frequency-set -f clock_freq

Replace clock_freq with the desired frequency value.
Limiting Frequency for a Specific Core:
First, get a list of available frequencies for a specific core (e.g., CPU0):
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies

This is VERY important, do NOT use a frequency that is not listed here!!


Choose a frequency from the list and set it as the maximum frequency:
echo 2600000 | sudo tee /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq

Repeat the above step for other cores (CPU1, CPU2, etc.).
Note: CPU Core numbering starts at 0, not 1.
Reboot.

This does not take effect until all the kernel parameters are loaded.
If you boot into the UEFI/BIOS, the Linux kernel isn't loaded.
At the Grub/Boot Menu, the kernel isn't loaded yet.
 
Last edited:
Oh come on, I have tried all of these tools. Like all of them. That is why by "software", I didn't mean programs like this,
Not as far as I know and with your condescending attitude you are on your own as far as I am concerned
 
@dos2unix

My firmware doesn't allow changing the turbo ratio limits. I can change the whole frequency of the CPU, but not of individual cores, which is what I want.

By "software", I meant that these programs change the frequency settings at hardware level. But since that is not possible for individual cores, I want to try emulating such setting through software.
how difficult is it for the kernel to inject a few hundred million NOP instructions every second on a given CPU thread?
In easier words, maybe limiting the total CPU usage on that specific CPU thread?
 


Follow Linux.org

Members online


Top