Re: Why do I sometimes "lose" the "psys" RAPL counter?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



CC Kan.

By checking the RAPL PMU code, it is possible that rdmsr_safe fails
when reading MSR_PLATFORM_ENERGY_STATUS.
But we don't have any debug message showing the exact failure reason.

can you please apply the patch attached and see why psys probe fails?

thanks,
rui

On Thu, 2020-03-26 at 03:15 -0700, Kenneth R. Crudup wrote:
> So I just tested a few shutdown vs. reboot cycles, and if I reboot, I
> only
> get three counters. If I shutdown, then restart, I get 4 counters
> (including
> the "psys domain" one).
> 
> I tried it on a few kernels, including the oldest one that comes with
> my
> distro (5.3.0-40-generic) where all the RAPL stuff is made as
> modules.
> 
> So, maybe we're not "clearing" (wild guess here) the "psys" RAPL on a
> reboot,
> something that would happen on a cold boot? (I'm afraid to say the
> "B-word",
> as that would mean it's a Dell issue so I won't hold my breath
> waiting for
> a fix).
> 
> 	-Kenny
> 
From 562bd4e7284ebc56ac6043466ccf1c57dff33002 Mon Sep 17 00:00:00 2001
From: Zhang Rui <rui.zhang@xxxxxxxxx>
Date: Sun, 29 Mar 2020 14:26:18 +0800
Subject: [PATCH] Debug patch to check psys RAPL DOMAIN registration.

Signed-off-by: Zhang Rui <rui.zhang@xxxxxxxxx>
---
 drivers/powercap/intel_rapl_common.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/powercap/intel_rapl_common.c b/drivers/powercap/intel_rapl_common.c
index 73257cf107d9..b83b80315481 100644
--- a/drivers/powercap/intel_rapl_common.c
+++ b/drivers/powercap/intel_rapl_common.c
@@ -1096,12 +1096,14 @@ int rapl_add_platform_domain(struct rapl_if_priv *priv)
 	ra.reg = priv->regs[RAPL_DOMAIN_PLATFORM][RAPL_DOMAIN_REG_STATUS];
 	ra.mask = ~0;
 	ret = priv->read_raw(0, &ra);
+	printk("platform_domain: read reg 0x%x, return 0x%x, ret %d\n", ra.reg, ra.value, ret);
 	if (ret || !ra.value)
 		return -ENODEV;
 
 	ra.reg = priv->regs[RAPL_DOMAIN_PLATFORM][RAPL_DOMAIN_REG_LIMIT];
 	ra.mask = ~0;
 	ret = priv->read_raw(0, &ra);
+	printk("platform_domain: read reg 0x%x, return 0x%x, ret %d\n", ra.reg, ra.value, ret);
 	if (ret || !ra.value)
 		return -ENODEV;
 
@@ -1128,6 +1130,7 @@ int rapl_add_platform_domain(struct rapl_if_priv *priv)
 
 	if (IS_ERR(power_zone)) {
 		kfree(rd);
+		printk("failed to register platform domain\n");
 		return PTR_ERR(power_zone);
 	}
 
-- 
2.17.1


[Index of Archives]     [Linux ACPI]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [CPU Freq]     [Kernel Newbies]     [Fedora Kernel]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux