mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-03-10 20:36:21 +03:00
get_cpu_freq: handle CPUs with variable frequency
If a CPU has variable frequency, then lscpu will list separate "CPU min freq" and "CPU max freq" values. In this case, take the maximum. Sponsored-by: TrueNAS Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Attila Fülöp <attila@fueloep.org> Reviewed-by: Tony Hutter <hutter2@llnl.gov> Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com> Signed-off-by: Rob Norris <rob.norris@truenas.com> Closes #18232
This commit is contained in:
parent
d06a1d9ac3
commit
b291d9aa22
@ -2896,7 +2896,7 @@ function is_mp
|
||||
function get_cpu_freq
|
||||
{
|
||||
if is_linux; then
|
||||
lscpu | awk '/CPU MHz/ { print $3 }'
|
||||
lscpu | awk '/CPU( max)? MHz/ { print $NF }'
|
||||
elif is_freebsd; then
|
||||
sysctl -n hw.clockrate
|
||||
else
|
||||
|
||||
Loading…
Reference in New Issue
Block a user