Skip to contentSkip to conversation

driver/tool fix for SPR Dram RAPL Domain

PATCH Applied Zhang Rui 3 participants 7 messages Sep 24, 2022 – Nov 2, 2022

Subsystems (4)
lore
Share & tools
lore

Zhang Rui

author
#0 lore raw

cover driver/tool fix for SPR Dram RAPL Domain

Intel Xeon servers used to use a fixed energy resolution (15.3uj) for Dram RAPL domain, starting from HasWell-X.

But on SPR, this changes.
The Dram RAPL domain uses 61uj energy resolution, which follows the standard energy resolution as described in MSR_RAPL_POWER_UNIT.

There are a couple of places that have implemented the energy unit quirk for SPR Dram RAPL domain, including intel-rapl driver, rapl perf pmu and the turbostat tool.

This patch series fixes them all, although they belong to different components.

thanks,
rui

author
#1 lore raw

PATCH 1/3 powercap: intel_rapl: Use standard Energy Unit for SPR Dram RAPL domain

Intel Xeon servers used to use a fixed energy resolution (15.3uj) for Dram RAPL domain. But on SPR, Dram RAPL domain follows the standard energy resolution as described in MSR_RAPL_POWER_UNIT.

Remove the SPR dram_domain_energy_unit quirk.

Fixes 2d798d9f5967 ("powercap: intel_rapl: add support for Sapphire Rapids")
---
 drivers/powercap/intel_rapl_common.c | 1 -
 1 file changed, 1 deletion(-)
drivers/powercap/intel_rapl_common.c +0 -1
index 949eb90f5733..d8eaa04bf2af 100644
@@ -1035,7 +1035,6 @@ static const struct rapl_defaults rapl_defaults_spr_server = {
 	.check_unit = rapl_check_unit_core,
 	.set_floor_freq = set_floor_freq_default,
 	.compute_time_window = rapl_compute_time_window_core,
-	.dram_domain_energy_unit = 15300,
 	.psys_domain_energy_unit = 1000000000,
 	.spr_psys_bits = true,
 };
Signature · 1 line
2.25.1
maintainer Applied
#2 lore raw

Re: [PATCH 1/3] powercap: intel_rapl: Use standard Energy Unit for SPR Dram RAPL domain

Quoted 19 lines · Zhang Rui

Intel Xeon servers used to use a fixed energy resolution (15.3uj) for Dram RAPL domain. But on SPR, Dram RAPL domain follows the standard energy resolution as described in MSR_RAPL_POWER_UNIT.

Remove the SPR dram_domain_energy_unit quirk.

Fixes 2d798d9f5967 ("powercap: intel_rapl: add support for Sapphire Rapids")
---
 drivers/powercap/intel_rapl_common.c | 1 -
 1 file changed, 1 deletion(-)
drivers/powercap/intel_rapl_common.c +0 -0
index 949eb90f5733..d8eaa04bf2af 100644

drivers/powercap/intel_rapl_common.c static const struct rapl_defaults rapl_defaults_spr_server = {

Quoted 8 lines
drivers/powercap/intel_rapl_common.c +0 -2
@@ -1035,7 +1035,6 @@ static const struct rapl_defaults rapl_defaults_spr_server = {
        .check_unit = rapl_check_unit_core,
        .set_floor_freq = set_floor_freq_default,
        .compute_time_window = rapl_compute_time_window_core,
-       .dram_domain_energy_unit = 15300,
        .psys_domain_energy_unit = 1000000000,
        .spr_psys_bits = true,
 };
--

Applied as 6.1 material, thanks!

author
#3 lore raw

PATCH 2/3 perf/x86/rapl: Use standard Energy Unit for SPR Dram RAPL domain

In reply to Zhang Rui

Intel Xeon servers used to use a fixed energy resolution (15.3uj) for Dram RAPL domain. But on SPR, Dram RAPL domain follows the standard energy resolution as described in MSR_RAPL_POWER_UNIT.

Remove the SPR Dram energy unit quirk.

Fixes bcfd218b6679 ("perf/x86/rapl: Add support for Intel SPR platform")
---
 arch/x86/events/rapl.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
arch/x86/events/rapl.c +1 -5
index 77e3a47af5ad..7d8db681880d 100644
@@ -619,12 +619,8 @@ static int rapl_check_hw_unit(struct rapl_model *rm)
 	case RAPL_UNIT_QUIRK_INTEL_HSW:
 		rapl_hw_unit[PERF_RAPL_RAM] = 16;
 		break;
-	/*
-	 * SPR shares the same DRAM domain energy unit as HSW, plus it
-	 * also has a fixed energy unit for Psys domain.
-	 */
+	/* SPR uses a fixed energy unit for Psys domain. */
 	case RAPL_UNIT_QUIRK_INTEL_SPR:
-		rapl_hw_unit[PERF_RAPL_RAM] = 16;
 		rapl_hw_unit[PERF_RAPL_PSYS] = 0;
 		break;
 	default:
Signature · 1 line
2.25.1
author
#4 lore raw

Re: [PATCH 2/3] perf/x86/rapl: Use standard Energy Unit for SPR Dram RAPL domain

Hi, Peter,

Can you please consider this as tip material?
This patch series does not get merged altogether. The intel-rapl and turbostat fixes have been merged by Rafael and Len respectively.

thanks,
rui

Quoted 34 lines · Zhang Rui

Intel Xeon servers used to use a fixed energy resolution (15.3uj) for Dram RAPL domain. But on SPR, Dram RAPL domain follows the standard energy resolution as described in MSR_RAPL_POWER_UNIT.

Remove the SPR Dram energy unit quirk.

Fixes bcfd218b6679 ("perf/x86/rapl: Add support for Intel SPR

platform")

---
 arch/x86/events/rapl.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
arch/x86/events/rapl.c +1 -5
index 77e3a47af5ad..7d8db681880d 100644
@@ -619,12 +619,8 @@ static int rapl_check_hw_unit(struct rapl_model
 *rm)
 	case RAPL_UNIT_QUIRK_INTEL_HSW:
 		rapl_hw_unit[PERF_RAPL_RAM] = 16;
 		break;
-	/*
-	 * SPR shares the same DRAM domain energy unit as HSW, plus it
-	 * also has a fixed energy unit for Psys domain.
-	 */
+	/* SPR uses a fixed energy unit for Psys domain. */
 	case RAPL_UNIT_QUIRK_INTEL_SPR:
-		rapl_hw_unit[PERF_RAPL_RAM] = 16;
 		rapl_hw_unit[PERF_RAPL_PSYS] = 0;
 		break;

default:

merge bot Applied
#5 lore raw

[tip: perf/urgent] perf/x86/rapl: Use standard Energy Unit for SPR Dram RAPL domain

In reply to Zhang Rui
The following commit has been merged into the perf/urgent branch of tip:

The following commit has been merged into the perf/urgent branch of tip:

Commit-ID:     80275ca9e525c198c7efe045c4a6cdb68a2ea763
Gitweb:        https://git.kernel.org/tip/80275ca9e525c198c7efe045c4a6cdb68a2ea763
Author:        Zhang Rui <[email protected]>
AuthorDate:    Sat, 24 Sep 2022 13:47:37 +08:00
Committer:     Peter Zijlstra <[email protected]>
CommitterDate: Wed, 02 Nov 2022 12:22:05 +01:00

perf/x86/rapl: Use standard Energy Unit for SPR Dram RAPL domain

Intel Xeon servers used to use a fixed energy resolution (15.3uj) for Dram RAPL domain. But on SPR, Dram RAPL domain follows the standard energy resolution as described in MSR_RAPL_POWER_UNIT.

Remove the SPR Dram energy unit quirk.

Fixes bcfd218b6679 ("perf/x86/rapl: Add support for Intel SPR platform")
---
 arch/x86/events/rapl.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
arch/x86/events/rapl.c +1 -5
index fea544e..a829492 100644
@@ -619,12 +619,8 @@ static int rapl_check_hw_unit(struct rapl_model *rm)
 	case RAPL_UNIT_QUIRK_INTEL_HSW:
 		rapl_hw_unit[PERF_RAPL_RAM] = 16;
 		break;
-	/*
-	 * SPR shares the same DRAM domain energy unit as HSW, plus it
-	 * also has a fixed energy unit for Psys domain.
-	 */
+	/* SPR uses a fixed energy unit for Psys domain. */
 	case RAPL_UNIT_QUIRK_INTEL_SPR:
-		rapl_hw_unit[PERF_RAPL_RAM] = 16;
 		rapl_hw_unit[PERF_RAPL_PSYS] = 0;
 		break;
 	default:
author
#6 lore raw

PATCH 3/3 tools/power turbostat: Use standard Energy Unit for SPR Dram RAPL domain

In reply to Zhang Rui

Intel Xeon servers used to use a fixed energy resolution (15.3uj) for Dram RAPL domain. But on SPR, Dram RAPL domain follows the standard energy resolution as described in MSR_RAPL_POWER_UNIT.

Remove the SPR rapl_dram_energy_units quirk.

Fixes e7af1ed3fa47 ("tools/power turbostat: Support additional CPU model numbers")
---
 tools/power/x86/turbostat/turbostat.c | 1 -
 1 file changed, 1 deletion(-)
tools/power/x86/turbostat/turbostat.c +0 -1
index 597cc2dbc456..e3e357df2a51 100644
@@ -4560,7 +4560,6 @@ static double rapl_dram_energy_units_probe(int model, double rapl_energy_units)
 	case INTEL_FAM6_SKYLAKE_X:	/* SKX */
 	case INTEL_FAM6_XEON_PHI_KNL:	/* KNL */
 	case INTEL_FAM6_ICELAKE_X:	/* ICX */
-	case INTEL_FAM6_SAPPHIRERAPIDS_X:	/* SPR */
 		return (rapl_dram_energy_units = 15.3 / 1000000);
 	default:
 		return (rapl_energy_units);
Signature · 1 line
2.25.1