]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
cpupower: Add support for amd-pstate preferred core rankings
authorMario Limonciello <mario.limonciello@amd.com>
Wed, 18 Dec 2024 19:09:52 +0000 (13:09 -0600)
committerShuah Khan <skhan@linuxfoundation.org>
Fri, 20 Dec 2024 16:12:07 +0000 (09:12 -0700)
The rankings are useful information to determine if the scheduler
is placing tasks appropriately for the hardware.

Link: https://lore.kernel.org/r/20241218191144.3440854-4-superm1@kernel.org
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
tools/power/cpupower/utils/helpers/amd.c

index 0a56e22240fc8b8b026db7d72e0f5055cc420a1a..090fdd6d15510254eab6f60c9a1fa14e10599f57 100644 (file)
@@ -177,6 +177,8 @@ enum amd_pstate_value {
        AMD_PSTATE_HIGHEST_PERF,
        AMD_PSTATE_MAX_FREQ,
        AMD_PSTATE_LOWEST_NONLINEAR_FREQ,
+       AMD_PSTATE_HW_PREFCORE,
+       AMD_PSTATE_PREFCORE_RANKING,
        MAX_AMD_PSTATE_VALUE_READ_FILES,
 };
 
@@ -184,6 +186,8 @@ static const char *amd_pstate_value_files[MAX_AMD_PSTATE_VALUE_READ_FILES] = {
        [AMD_PSTATE_HIGHEST_PERF] = "amd_pstate_highest_perf",
        [AMD_PSTATE_MAX_FREQ] = "amd_pstate_max_freq",
        [AMD_PSTATE_LOWEST_NONLINEAR_FREQ] = "amd_pstate_lowest_nonlinear_freq",
+       [AMD_PSTATE_HW_PREFCORE] = "amd_pstate_hw_prefcore",
+       [AMD_PSTATE_PREFCORE_RANKING] = "amd_pstate_prefcore_ranking",
 };
 
 static unsigned long amd_pstate_get_data(unsigned int cpu,
@@ -240,6 +244,10 @@ void amd_pstate_show_perf_and_freq(unsigned int cpu, int no_rounding)
               acpi_cppc_get_data(cpu, LOWEST_PERF));
        print_speed(acpi_cppc_get_data(cpu, LOWEST_FREQ) * 1000, no_rounding);
        printf(".\n");
+
+       printf(_("    Preferred Core Support: %lu. Preferred Core Ranking: %lu.\n"),
+              amd_pstate_get_data(cpu, AMD_PSTATE_HW_PREFCORE),
+              amd_pstate_get_data(cpu, AMD_PSTATE_PREFCORE_RANKING));
 }
 
 /* AMD P-State Helper Functions ************************************/