x86: Print ratio freq_max/freq_base used in frequency invariance calculations
authorGiovanni Gherdovich <ggherdovich@suse.cz>
Thu, 12 Nov 2020 18:26:14 +0000 (19:26 +0100)
committerIngo Molnar <mingo@kernel.org>
Fri, 11 Dec 2020 09:30:23 +0000 (10:30 +0100)
The value freq_max/freq_base is a fundamental component of frequency
invariance calculations. It may come from a variety of sources such as MSRs
or ACPI data, tracking it down when troubleshooting a system could be
non-trivial. It is worth saving it in the kernel logs.

 # dmesg | grep 'Estimated ratio of average max'
 [   14.024036] smpboot: Estimated ratio of average max frequency by base frequency (times 1024): 1289

Signed-off-by: Giovanni Gherdovich <ggherdovich@suse.cz>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lkml.kernel.org/r/20201112182614.10700-4-ggherdovich@suse.cz
arch/x86/kernel/smpboot.c

index c5dd5f6199d98496756e8e698d50dd1bed921cc1..3577bb756d64e9929cc779ff2b058905adff1b2c 100644 (file)
@@ -2110,6 +2110,7 @@ static void init_freq_invariance(bool secondary, bool cppc_ready)
        if (ret) {
                init_counter_refs();
                static_branch_enable(&arch_scale_freq_key);
+               pr_info("Estimated ratio of average max frequency by base frequency (times 1024): %llu\n", arch_max_freq_ratio);
        } else {
                pr_debug("Couldn't determine max cpu frequency, necessary for scale-invariant accounting.\n");
        }