Commit 6d4a2987 authored by Mario Limonciello's avatar Mario Limonciello Committed by Shuah Khan
Browse files

cpupower: Add support for amd-pstate preferred core rankings

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: default avatarMario Limonciello <mario.limonciello@amd.com>
Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
parent 3f2eb760
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -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 ************************************/