0

I am running CentOS 7 (7.9.2009) (kernel 3.10.0-1160.49.1.el7.x86_64) on a rather old laptop (Lenove T61) with a dual core CPU (Intel(R) Core(TM)2 Duo CPU T7300 @ 2.00GHz). The driver for CPU scaling is acpi-cpufreq, and when on the performance governor, I can get the CPU to run at the max CPU speed as listed in /sys/devices/system/cpu/cpufreq/policy0/cpuinfo_max_freq, and observe this by doing:

$ grep -i mhz /proc/cpuinfo 
cpu MHz     : 2001.000
cpu MHz     : 2001.000

and it is rock-steady at this speed. I can verify this by doing:

$ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq
2001000
$ sudo cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq 
2001000

I am trying to run at a constant frequency for a real-time program that counts CPU clock cycles for timing. I compiled a custom kernel (5.10.83-rt58) to support a piece of hardware that isn't supported in the default CentOS kernel (3.10.0). CPU scaling usually causes the clock frequency to jump around, but I found that I can get a steady frequency by setting all the values in /sys/devices/system/cpu/cpu*/cpuidle/state*/disable to 1. When I check the frequency:

$ grep -i mhz /proc/cpuinfo 
cpu MHz     : 1995.106
cpu MHz     : 1995.106

it is not quite at the 2001MHz as seen with the 3.10.0 kernel. The following command verifies this:

$ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq
1995106

But the output of:

$ sudo cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq
2001000

is different. My question is does anyone know why my CPU isn't running at the maximum frequency (2001MHz) but at ~6MHz less? Did something drastic change in cpu scaling between kernel 3.10 and 5.10?

3
  • Fascinating. I see something different. My laptop with a T7300 runs at 2055-2077 MHz with the performance governor—the scheduler somehow overclocks the CPU. Using the schedutil governor (default) it typically tops out at 1995 MHz, too. Strange stuff.
    – Daniel B
    Dec 30, 2021 at 11:03
  • @DanielB, what kind of laptop is it are you also running CentOS 7 and kernel 3.10.0?
    – Mitch
    Dec 31, 2021 at 20:38
  • It’s a ThinkPad R61e, with Arch Linux (so an up-to-date kernel) though.
    – Daniel B
    Dec 31, 2021 at 20:48

1 Answer 1

0

I found that adding the kernel parameters nohz_full=1 rcu_nocbs=1 mitigations=off was able to get one of my cores to run at 2001MHz on kernel 5.10.83-rt58. Bear in mind, adding mitigations=off will disable mitigations for CPU vulnerabilities. I'm not sure if these parameters were available on the 3.10.0-1160.49.1.el7.x86_64 kernel, but the full list of kernel parameters is here.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .