Home > OS >  How to get Maximum CPU frequency
How to get Maximum CPU frequency

Time:08-26

I want to get the maximum frequency the cpu is designed for by the manufacturer. On Linux I can get the frequency each core is currently operating at by reading "/proc/cpuinfo" but I want max frequency (The rated frequency is written in the model name in "/proc/cpuinfo" but I don't know if this is the case for AMD processors or not). How can I get this information? Is there a way to do this on windows as well? All answers our much appreciated.

CodePudding user response:

Under linux, for a given CPU (e.g. N), look at the /sys/devices/system/cpu/cpuN/cpufreq directory.

In that directory there are many interesting files:

affected_cpus
bios_limit
cpuinfo_cur_freq
cpuinfo_max_freq
cpuinfo_min_freq
cpuinfo_transition_latency
freqdomain_cpus
related_cpus
scaling_available_frequencies
scaling_available_governors
scaling_cur_freq
scaling_driver
scaling_governor
scaling_max_freq
scaling_min_freq
scaling_setspeed
stats

In particular, cpuinfo_max_freq is the one you want to look at.

The above directory can be a symlink to ../cpufreq/policyN, so you may need to explore further for the particulars of your given kernel version.


On my system, doing head -10 * in the cpu0/cpufreq directory produces:

==> affected_cpus <==
0

==> bios_limit <==
2793000

==> cpuinfo_cur_freq <==
1596000

==> cpuinfo_max_freq <==
2793000

==> cpuinfo_min_freq <==
1596000

==> cpuinfo_transition_latency <==
10000

==> freqdomain_cpus <==
0 1 2 3 4 5 6 7

==> related_cpus <==
0

==> scaling_available_frequencies <==
2793000 2660000 2527000 2394000 2261000 2128000 1995000 1862000 1729000 1596000

==> scaling_available_governors <==
conservative userspace powersave ondemand performance schedutil

==> scaling_cur_freq <==
2622753

==> scaling_driver <==
acpi-cpufreq

==> scaling_governor <==
ondemand

==> scaling_max_freq <==
2793000

==> scaling_min_freq <==
1596000

==> scaling_setspeed <==
<unsupported>

==> stats <==

Some systems can throttle cpus [for power reduction, etc.] based on workload/demand.

That is controlled by the scaling_governor file. It can be read/written and can control the scaling policy.

In the past, the values I've used are:

  1. ondemand -- The kernel will adjust CPU frequency up/down based on demand/workload
  2. performance -- CPU will always run at maximum frequency
  • Related