From b291d9aa2267788c22338ae8c6ec44c1a59dd55d Mon Sep 17 00:00:00 2001 From: Rob Norris Date: Wed, 18 Feb 2026 13:27:41 +1100 Subject: [PATCH] get_cpu_freq: handle CPUs with variable frequency MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Attila Fülöp Reviewed-by: Tony Hutter Reviewed-by: Alexander Motin Signed-off-by: Rob Norris Closes #18232 --- tests/zfs-tests/include/libtest.shlib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/zfs-tests/include/libtest.shlib b/tests/zfs-tests/include/libtest.shlib index 096d6b18e..3c0c4eb5f 100644 --- a/tests/zfs-tests/include/libtest.shlib +++ b/tests/zfs-tests/include/libtest.shlib @@ -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