Skip to contentSkip to conversation

cpupower: Remove incorrect EPP dependency in get_latency()

PATCH In review Kaushlendra Kumar 3 participants 7 messages Feb 4 – Feb 11 CPU power monitoring

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cpupower: Remove incorrect EPP dependency in get_latency()

The get_latency() function incorrectly called get_epp() and returned error if EPP (Energy Performance Preference) was not available, even though transition latency and EPP are completely independent CPU frequency features.

---
 tools/power/cpupower/utils/cpufreq-info.c | 3 ---
 1 file changed, 3 deletions(-)
tools/power/cpupower/utils/cpufreq-info.c +0 -3
index 5fe01e516817..4a9172f4599f 100644
@@ -459,9 +459,6 @@ static int get_latency(unsigned int cpu, unsigned int human)
 {
 	unsigned long latency = cpufreq_get_transition_latency(cpu);
 
-	if (!get_epp(cpu, false))
-		return -EINVAL;
-
 	printf(_("  maximum transition latency: "));
 	if (!latency || latency == UINT_MAX) {
 		printf(_(" Cannot determine or is not supported.\n"));
Signature · 1 line
2.34.1
maintainer
#1 lore raw
Quoted 4 lines · Kaushlendra Kumar

The get_latency() function incorrectly called get_epp() and returned error if EPP (Energy Performance Preference) was not available, even though transition latency and EPP are completely independent CPU frequency features.

How did you find this problem? Are EPP and CPU frequency features independent on non-intel platforms?

Quoted 11 lines
---
  tools/power/cpupower/utils/cpufreq-info.c | 3 ---
  1 file changed, 3 deletions(-)
tools/power/cpupower/utils/cpufreq-info.c +0 -0
index 5fe01e516817..4a9172f4599f 100644

tools/power/cpupower/utils/cpufreq-info.c static int get_latency(unsigned int cpu, unsigned int human) · line 464

Quoted 9 lines
tools/power/cpupower/utils/cpufreq-info.c +0 -3
@@ -459,9 +459,6 @@ static int get_latency(unsigned int cpu, unsigned int human)
  {
  	unsigned long latency = cpufreq_get_transition_latency(cpu);
 
-	if (!get_epp(cpu, false))
-		return -EINVAL;
-
  	printf(_("  maximum transition latency: "));
  	if (!latency || latency == UINT_MAX) {
  		printf(_(" Cannot determine or is not supported.\n"));

thanks,
-- Shuah

#2 lore raw
Quoted 8 lines · Shuah Khan
Quoted 4 lines · Kaushlendra Kumar

The get_latency() function incorrectly called get_epp() and returned error if EPP (Energy Performance Preference) was not available, even though transition latency and EPP are completely independent CPU frequency features.

How did you find this problem? Are EPP and CPU frequency features independent on non-intel platforms?

Hi Shuah,

Why do we need to call get_epp() after capturing the latency?

The erroneous get_epp() check can cause get_latency() to fail, even though valid latency information is available.

Thanks,
Kaushlendra

maintainer
#3 lore raw
Quoted 7 lines · Kaushlendra
Quoted 6 lines · Shuah Khan
Quoted 4 lines · Kaushlendra Kumar

The get_latency() function incorrectly called get_epp() and returned error if EPP (Energy Performance Preference) was not available, even though transition latency and EPP are completely independent CPU frequency features.

Quoted 8 lines
Quoted 2 lines

How did you find this problem? Are EPP and CPU frequency features independent on non-intel platforms?

Hi Shuah,

Why do we need to call get_epp() after capturing the latency?

The erroneous get_epp() check can cause get_latency() to fail, even though valid latency information is available.

You didn't answer my second question about non-intel platforms?

thanks,
-- Shuah

#4 lore raw
Quoted 11 lines · Shuah Khan
Quoted 10 lines · Kaushlendra
Quoted 8 lines · Shuah Khan
Quoted 4 lines · Kaushlendra Kumar

The get_latency() function incorrectly called get_epp() and returned error if EPP (Energy Performance Preference) was not available, even though transition latency and EPP are completely independent CPU frequency features.

How did you find this problem? Are EPP and CPU frequency features independent on non-intel platforms?

Quoted 7 lines
Quoted 5 lines

Hi Shuah,

Why do we need to call get_epp() after capturing the latency?

The erroneous get_epp() check can cause get_latency() to fail, even though valid latency information is available.

You didn't answer my second question about non-intel platforms?

Hi Shuah,

EPP (Energy Performance Preference) is Intel-specific and part of Intel's Hardware P-States. So, on non intel platforms these are not related.

BR,
Kaushlendra

#5 lore raw
Quoted 17 lines · Kaushlendra
Quoted 15 lines · Shuah Khan
Quoted 14 lines · Kaushlendra
Quoted 8 lines · Shuah Khan
Quoted 4 lines · Kaushlendra Kumar

The get_latency() function incorrectly called get_epp() and returned error if EPP (Energy Performance Preference) was not available, even though transition latency and EPP are completely independent CPU frequency features.

How did you find this problem? Are EPP and CPU frequency features independent on non-intel platforms?

Hi Shuah,

Why do we need to call get_epp() after capturing the latency?

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

The erroneous get_epp() check can cause get_latency() to fail, even though valid latency information is available.

You didn't answer my second question about non-intel platforms?

Hi Shuah,

EPP (Energy Performance Preference) is Intel-specific and part of Intel's Hardware P-States.

That's not actually correct, EPP is part of ACPI CPPC now and amd-pstate uses it. cppc_cpufreq uses it too IIRC.

Quoted 1 line

So, on non intel platforms these are not related.

Please double check.

#6 lore raw
Quoted 24 lines · Rafael J. Wysocki
Quoted 23 lines · Kaushlendra
Quoted 11 lines · Shuah Khan
Quoted 10 lines · Kaushlendra
Quoted 8 lines · Shuah Khan
Quoted 4 lines · Kaushlendra Kumar

The get_latency() function incorrectly called get_epp() and returned error if EPP (Energy Performance Preference) was not available, even though transition latency and EPP are completely independent CPU frequency features.

How did you find this problem? Are EPP and CPU frequency features independent on non-intel platforms?

Quoted 7 lines
Quoted 5 lines

Hi Shuah,

Why do we need to call get_epp() after capturing the latency?

The erroneous get_epp() check can cause get_latency() to fail, even though valid latency information is available.

You didn't answer my second question about non-intel platforms?

Hi Shuah,

Quoted 7 lines
Quoted 1 line

EPP (Energy Performance Preference) is Intel-specific and part of Intel's Hardware P-States.

That's not actually correct, EPP is part of ACPI CPPC now and amd-pstate uses it. cppc_cpufreq uses it too IIRC.

Quoted 1 line

So, on non intel platforms these are not related.

Please double check.

Hi Rafael,

Thank you for the correction.

Apology for the confusion. Let me check how EPP and CPU frequency are related on AMD platform.

Kaushlendra