Skip to contentSkip to conversation

Misc RAPL updates

PATCH Applied Jacob Pan 3 participants 10 messages May 23, 2016 – Jun 16, 2016 Power management core

v1 of 2 Applied Latest is v2 →

lore
Share & tools
lore
author
#1 lore raw

PATCH 1/2 powercap/rapl: add support for skx

In reply to Jacob Pan

SKX RAPL interface is similar to HSX/BDX.

---
 drivers/powercap/intel_rapl.c | 1 +
 1 file changed, 1 insertion(+)
drivers/powercap/intel_rapl.c +1 -0
index 470bb62..a417e68 100644
@@ -1096,6 +1096,7 @@ static const struct x86_cpu_id rapl_ids[] __initconst = {
 	RAPL_CPU(0x4E, rapl_defaults_core),/* Skylake */
 	RAPL_CPU(0x4C, rapl_defaults_cht),/* Braswell/Cherryview */
 	RAPL_CPU(0x4A, rapl_defaults_tng),/* Tangier */
+	RAPL_CPU(0x55, rapl_defaults_hsw_server),/* Skylake server */
 	RAPL_CPU(0x56, rapl_defaults_core),/* Future Xeon */
 	RAPL_CPU(0x5A, rapl_defaults_ann),/* Annidale */
 	RAPL_CPU(0X5C, rapl_defaults_core),/* Broxton */
Signature · 1 line
1.9.1
author
#8 lore raw

PATCH 2/2 powercap/rapl: reduce warning level

In reply to Jacob Pan

Since RAPL interface is not architectual, its enumeration depends on poking MSRs instead of using CPUID method.

In KVM guest, RAPL driver probe will fail and emit the following message for every CPU: no valid rapl domains found in package

This patch limit the warning to debug only. Still return ENODEV so that RAPL does not run on KVM guest.

---
 drivers/powercap/intel_rapl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/powercap/intel_rapl.c +1 -1
index a417e68..b0a2dc4 100644
@@ -1324,7 +1324,7 @@ static int rapl_detect_domains(struct rapl_package *rp, int cpu)
 	}
 	rp->nr_domains = bitmap_weight(&rp->domain_map,	RAPL_DOMAIN_MAX);
 	if (!rp->nr_domains) {
-		pr_err("no valid rapl domains found in package %d\n", rp->id);
+		pr_debug("no valid rapl domains found in package %d\n", rp->id);
 		ret = -ENODEV;
 		goto done;
 	}
Signature · 1 line
1.9.1

Jacob Pan

author
#0 lore raw

cover Misc RAPL updates

A couple of small updates to support Skylake server and make it less noisy on KVM.

Jacob Pan (2):
powercap/rapl: add support for skx
powercap/rapl: reduce warning level

 drivers/powercap/intel_rapl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Signature · 1 line
1.9.1
#2 lore raw

Re: [PATCH 1/2] powercap/rapl: add support for skx

In reply to Jacob Pan
Quoted 13 lines · Jacob Pan

SKX RAPL interface is similar to HSX/BDX.

---
 drivers/powercap/intel_rapl.c | 1 +
 1 file changed, 1 insertion(+)
drivers/powercap/intel_rapl.c +0 -0
index 470bb62..a417e68 100644

drivers/powercap/intel_rapl.c static const struct x86_cpu_id rapl_ids[] __initconst = { · line 1102

Quoted 7 lines
drivers/powercap/intel_rapl.c +1 -0
@@ -1096,6 +1096,7 @@ static const struct x86_cpu_id rapl_ids[] __initconst = {
 	RAPL_CPU(0x4E, rapl_defaults_core),/* Skylake */
 	RAPL_CPU(0x4C, rapl_defaults_cht),/* Braswell/Cherryview */
 	RAPL_CPU(0x4A, rapl_defaults_tng),/* Tangier */
+	RAPL_CPU(0x55, rapl_defaults_hsw_server),/* Skylake server */
 	RAPL_CPU(0x56, rapl_defaults_core),/* Future Xeon */
 	RAPL_CPU(0x5A, rapl_defaults_ann),/* Annidale */
 	RAPL_CPU(0X5C, rapl_defaults_core),/* Broxton */

Can you please rebase this on top of 4.7-rc3?

Thanks,
Rafael

#3 lore raw

Re: [PATCH 1/2] powercap/rapl: add support for skx

Quoted 8 lines · Rafael J. Wysocki
Quoted 7 lines · Jacob Pan

SKX RAPL interface is similar to HSX/BDX.

---
 drivers/powercap/intel_rapl.c | 1 +
 1 file changed, 1 insertion(+)
Quoted 15 lines

drivers/powercap/intel_rapl.c static const struct x86_cpu_id rapl_ids[] __initconst = { · line 1102

Quoted 13 lines
drivers/powercap/intel_rapl.c +1 -0
index 470bb62..a417e68 100644
@@ -1096,6 +1096,7 @@ static const struct x86_cpu_id rapl_ids[] __initconst = {
 	RAPL_CPU(0x4E, rapl_defaults_core),/* Skylake */
 	RAPL_CPU(0x4C, rapl_defaults_cht),/* Braswell/Cherryview */
 	RAPL_CPU(0x4A, rapl_defaults_tng),/* Tangier */
+	RAPL_CPU(0x55, rapl_defaults_hsw_server),/* Skylake server */
 	RAPL_CPU(0x56, rapl_defaults_core),/* Future Xeon */
 	RAPL_CPU(0x5A, rapl_defaults_ann),/* Annidale */
 	RAPL_CPU(0X5C, rapl_defaults_core),/* Broxton */

Can you please rebase this on top of 4.7-rc3?

Or rather on top of the x86/cpu branch from tip?

BTW, I can take the Denverton support for RAPL too (unless already applied elsewhere), but it has to be based on x86/cpu as well.

Thanks,
Rafael

author
#4 lore raw

Re: [PATCH 1/2] powercap/rapl: add support for skx

Quoted 25 lines · On Mon, 13 Jun 2016 23:56:18 +0200 "Rafael J. Wysocki" <[email protected]>…
Quoted 8 lines · Rafael J. Wysocki
Quoted 7 lines · Jacob Pan

SKX RAPL interface is similar to HSX/BDX.

---
 drivers/powercap/intel_rapl.c | 1 +
 1 file changed, 1 insertion(+)
Quoted 15 lines

drivers/powercap/intel_rapl.c static const struct x86_cpu_id rapl_ids[] __initconst = { · line 1102

Quoted 13 lines
(quoted diff) +0 -0

b/drivers/powercap/intel_rapl.c index 470bb62..a417e68 100644

drivers/powercap/intel_rapl.c +0 -0
@@ -1096,6 +1096,7 @@ static const struct x86_cpu_id rapl_ids[]

__initconst = { RAPL_CPU(0x4E, rapl_defaults_core),/* Skylake */
RAPL_CPU(0x4C, rapl_defaults_cht),/* Braswell/Cherryview
*/ RAPL_CPU(0x4A, rapl_defaults_tng),/* Tangier */

drivers/powercap/intel_rapl.c +1 -0
+	RAPL_CPU(0x55, rapl_defaults_hsw_server),/* Skylake

server */ RAPL_CPU(0x56, rapl_defaults_core),/* Future Xeon */

drivers/powercap/intel_rapl.c +0 -0
 	RAPL_CPU(0x5A, rapl_defaults_ann),/* Annidale */
 	RAPL_CPU(0X5C, rapl_defaults_core),/* Broxton */

Can you please rebase this on top of 4.7-rc3?

Quoted 2 lines

Or rather on top of the x86/cpu branch from tip?

done. just sent you v2.
[PATCH v2] powercap/rapl: add support for denverton

Quoted 3 lines

BTW, I can take the Denverton support for RAPL too (unless already applied elsewhere), but it has to be based on x86/cpu as well.

Not applied elsewhere, please take it. I was confused powercap/rapl with perf/rapl which should be in tip.

#5 lore raw

Re: [PATCH 1/2] powercap/rapl: add support for skx

Quoted 28 lines · Jacob Pan
Quoted 25 lines · On Mon, 13 Jun 2016 23:56:18 +0200 "Rafael J. Wysocki" <[email protected]>…
Quoted 23 lines · Rafael J. Wysocki
Quoted 12 lines · Jacob Pan

SKX RAPL interface is similar to HSX/BDX.

---
 drivers/powercap/intel_rapl.c | 1 +
 1 file changed, 1 insertion(+)
(quoted diff) +0 -0

b/drivers/powercap/intel_rapl.c index 470bb62..a417e68 100644

drivers/powercap/intel_rapl.c +0 -0
@@ -1096,6 +1096,7 @@ static const struct x86_cpu_id rapl_ids[]
Quoted 8 lines

__initconst = { RAPL_CPU(0x4E, rapl_defaults_core),/* Skylake */
RAPL_CPU(0x4C, rapl_defaults_cht),/* Braswell/Cherryview
*/ RAPL_CPU(0x4A, rapl_defaults_tng),/* Tangier */
+ RAPL_CPU(0x55, rapl_defaults_hsw_server),/* Skylake server */ RAPL_CPU(0x56, rapl_defaults_core),/* Future Xeon */ RAPL_CPU(0x5A, rapl_defaults_ann),/* Annidale */ RAPL_CPU(0X5C, rapl_defaults_core),/* Broxton */

Can you please rebase this on top of 4.7-rc3?

Quoted 4 lines
Quoted 2 lines

Or rather on top of the x86/cpu branch from tip?

done. just sent you v2.
[PATCH v2] powercap/rapl: add support for denverton

Thanks for that one, but the $subject one was for SKX. Any chance to rebase and resend this one too?

author
#6 lore raw

Re: [PATCH 1/2] powercap/rapl: add support for skx

Quoted 30 lines · On Tue, 14 Jun 2016 02:21:41 +0200 "Rafael J. Wysocki" <[email protected]>…
Quoted 28 lines · Jacob Pan
Quoted 25 lines · On Mon, 13 Jun 2016 23:56:18 +0200 "Rafael J. Wysocki" <[email protected]>…
Quoted 23 lines · Rafael J. Wysocki
Quoted 12 lines · Jacob Pan

SKX RAPL interface is similar to HSX/BDX.

---
 drivers/powercap/intel_rapl.c | 1 +
 1 file changed, 1 insertion(+)
(quoted diff) +0 -0

b/drivers/powercap/intel_rapl.c index 470bb62..a417e68 100644

drivers/powercap/intel_rapl.c +0 -0
@@ -1096,6 +1096,7 @@ static const struct x86_cpu_id rapl_ids[]
Quoted 8 lines

__initconst = { RAPL_CPU(0x4E, rapl_defaults_core),/* Skylake */ RAPL_CPU(0x4C, rapl_defaults_cht),/* Braswell/Cherryview */ RAPL_CPU(0x4A, rapl_defaults_tng),/* Tangier */
+ RAPL_CPU(0x55, rapl_defaults_hsw_server),/* Skylake server */ RAPL_CPU(0x56, rapl_defaults_core),/* Future Xeon */ RAPL_CPU(0x5A, rapl_defaults_ann),/* Annidale */ RAPL_CPU(0X5C, rapl_defaults_core),/* Broxton */

Can you please rebase this on top of 4.7-rc3?

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

Or rather on top of the x86/cpu branch from tip?

done. just sent you v2.
[PATCH v2] powercap/rapl: add support for denverton

Thanks for that one, but the $subject one was for SKX. Any chance to rebase and resend this one too?

SKX has already been added by commit below in tip/x86/cpu:

commit d40671e30cb46e834651e0ce3d4590c915171414

Author: Dave Hansen <[email protected]>
Date:   Thu Jun 2 17:19:55 2016 -0700

x86, powercap, rapl: Add Skylake Server model number

SKX uses similar RAPL interface as Broadwell server according to Jacob Pan.

Cc Andy Lutomirski <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc Brian Gerst <[email protected]>
Cc Dave Hansen <[email protected]>
Cc Denys Vlasenko <[email protected]>
Cc H. Peter Anvin <[email protected]>
Cc Jacob Pan <[email protected]>
Cc Linus Torvalds <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Rafael J. Wysocki <[email protected]>
Cc Thomas Gleixner <[email protected]>
drivers/powercap/intel_rapl.c +1 -0
index f4f8532..2e8f2be 100644
@@ -1114,6 +1114,7 @@ static const struct x86_cpu_id rapl_ids[] __initconst = {
 
        RAPL_CPU(INTEL_FAM6_SKYLAKE_DESKTOP,    rapl_defaults_core),
        RAPL_CPU(INTEL_FAM6_SKYLAKE_MOBILE,     rapl_defaults_core),
+       RAPL_CPU(INTEL_FAM6_SKYLAKE_X,          rapl_defaults_hsw_server),
        RAPL_CPU(INTEL_FAM6_KABYLAKE_MOBILE,    rapl_defaults_core),
        RAPL_CPU(INTEL_FAM6_KABYLAKE_DESKTOP,   rapl_defaults_core),
 
#7 lore raw

Re: [PATCH 1/2] powercap/rapl: add support for skx

Quoted 41 lines · Jacob Pan
Quoted 30 lines · On Tue, 14 Jun 2016 02:21:41 +0200 "Rafael J. Wysocki" <[email protected]>…
Quoted 28 lines · Jacob Pan
Quoted 25 lines · On Mon, 13 Jun 2016 23:56:18 +0200 "Rafael J. Wysocki" <[email protected]>…
Quoted 23 lines · Rafael J. Wysocki
Quoted 12 lines · Jacob Pan

SKX RAPL interface is similar to HSX/BDX.

---
 drivers/powercap/intel_rapl.c | 1 +
 1 file changed, 1 insertion(+)
(quoted diff) +0 -0

b/drivers/powercap/intel_rapl.c index 470bb62..a417e68 100644

drivers/powercap/intel_rapl.c +0 -0
@@ -1096,6 +1096,7 @@ static const struct x86_cpu_id rapl_ids[]
Quoted 8 lines

__initconst = { RAPL_CPU(0x4E, rapl_defaults_core),/* Skylake */ RAPL_CPU(0x4C, rapl_defaults_cht),/* Braswell/Cherryview */ RAPL_CPU(0x4A, rapl_defaults_tng),/* Tangier */
+ RAPL_CPU(0x55, rapl_defaults_hsw_server),/* Skylake server */ RAPL_CPU(0x56, rapl_defaults_core),/* Future Xeon */ RAPL_CPU(0x5A, rapl_defaults_ann),/* Annidale */ RAPL_CPU(0X5C, rapl_defaults_core),/* Broxton */

Can you please rebase this on top of 4.7-rc3?

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

Or rather on top of the x86/cpu branch from tip?

done. just sent you v2.
[PATCH v2] powercap/rapl: add support for denverton

Thanks for that one, but the $subject one was for SKX. Any chance to rebase and resend this one too?

Quoted 7 lines

SKX has already been added by commit below in tip/x86/cpu:

commit d40671e30cb46e834651e0ce3d4590c915171414

Author: Dave Hansen <[email protected]>
Date:   Thu Jun 2 17:19:55 2016 -0700

x86, powercap, rapl: Add Skylake Server model number

OK, thanks!

#9 lore raw

Re: [PATCH 2/2] powercap/rapl: reduce warning level

In reply to Jacob Pan
Quoted 10 lines · Jacob Pan

Since RAPL interface is not architectual, its enumeration depends on poking MSRs instead of using CPUID method.

In KVM guest, RAPL driver probe will fail and emit the following message for every CPU: no valid rapl domains found in package

This patch limit the warning to debug only. Still return ENODEV so that RAPL does not run on KVM guest.

Applied, thanks!