fwts: cpufreq reports two identical frequencies but one is slower

Bug #1322531 reported by Alex Hung
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Firmware Test Suite
Fix Released
Medium
Colin Ian King

Bug Description

In UEFI Plugfest, we saw a failure such as "cpufreq: Supposedly higher frequency 1.95 GHz is slower (164331 bogo loops) than frequency 1.95 GHz (234336 bogo loops) on CPU 2."

It can be two CPU state are very close to each other, it will be nice to detect this false alarm.

Revision history for this message
Colin Ian King (colin-king) wrote :

I guess this may also be because the faster one is running in a Turbo state, where as the lower isn't on turbo state, for example, my laptop shows:

  2.55 GHz | 100.0 % | 290890
  2.55 GHz | 82.1 % | 238966
  2.45 GHz | 78.5 % | 228338
  2.35 GHz | 75.5 % | 219765
etc

The P-State _PSS data is:

P-State Freq Power Latency Bus Master
         (MHz) (mW) (us) Latency (us)
   0 2501 35000 10 10
   1 2500 35000 10 10
   2 2400 33218 10 10
   3 2300 31470 10 10

in which case it's OK since the turbo state is 2501 Mhz which is marginally higher than the next P state of 2500 Mhz, however some machines have a turbo setting set the same frequency as the next highest setting, hence this "false positive".

I agree we need some kind of fuzzy slack boundary, say 1 or 2% to wiggle around these kind of issues. Does that make sense?

Revision history for this message
Colin Ian King (colin-king) wrote :

BTW, do we have the _PSS data for this failure?

Changed in fwts:
importance: Undecided → Medium
Revision history for this message
Ivan Hu (ivan.hu) wrote :

I got the log for another machine, the same failure.

CPU 1: 13 CPU frequency steps supported.
 Frequency | Relative Speed | Bogo loops
-----------+----------------+-----------
  2.35 GHz | 100.0 % | 333388
  2.35 GHz | 65.7 % | 219027
  2.25 GHz | 62.8 % | 209502
  2.15 GHz | 60.0 % | 199958
  2.05 GHz | 57.1 % | 190433
  1.95 GHz | 54.3 % | 180898
  1.85 GHz | 51.4 % | 171377
  1.75 GHz | 48.5 % | 161813
  1.65 GHz | 45.7 % | 152314
  1500 MHz | 42.8 % | 142780
  1400 MHz | 39.9 % | 133078
  1300 MHz | 37.0 % | 123494
  1200 MHz | 51.3 % | 170996

FAILED [MEDIUM] CPUFreqSlowerOnCPU: Test 1, Supposedly higher frequency 1300 MHz
is slower (123494 bogo loops) than frequency 1300 MHz (170996 bogo loops) on CPU 1.

Revision history for this message
Colin Ian King (colin-king) wrote :

Why is that a false positive? 1300 Mhz @ 37% CPU loading (123494 bogo ops) is slower than the 1200 Mhz @ 51.3% CPU loading (170996 bogo ops), so that does look like a failure to me.

Changed in fwts:
assignee: nobody → Colin King (colin-king)
status: New → In Progress
summary: - fwts-live: cpufreq reports two identifical frequency but one is slower
+ fwts-live: cpufreq reports two identical frequency but one is slower
summary: - fwts-live: cpufreq reports two identical frequency but one is slower
+ fwts-live: cpufreq reports two identical frequencies but one is slower
Revision history for this message
Colin Ian King (colin-king) wrote : Re: fwts-live: cpufreq reports two identical frequencies but one is slower

With the original comment in #1, I think that the _PSS freqs were the same, or very close because of the turbo mode on the processor. The sorting of these values originally got fooled by identical _PSS values causing TurboBoost value and non-TurboBoots _PSS top two frequencies to be swapped if they are the same value.

So the fix is to also compare the bogo speeds when the _PSS values are the same or very close. Fix sent to list for review: https://lists.ubuntu.com/archives/fwts-devel/2014-May/004833.html

I tested this by shoving the values in comment #1 into the test and the fix resolved this false positive.

summary: - fwts-live: cpufreq reports two identical frequencies but one is slower
+ fwts: cpufreq reports two identical frequencies but one is slower
Revision history for this message
Ivan Hu (ivan.hu) wrote :

for Comments#4,
I saw something wrong with the frequency both 1300Mhz, one should be 1200Mhz.

FAILED [MEDIUM] CPUFreqSlowerOnCPU: Test 1, Supposedly higher frequency 1300 MHz
is slower (123494 bogo loops) than frequency 1300 MHz (170996 bogo loops) on CPU 1.

Revision history for this message
Yang Kun (YK) (dayangkuncn) wrote :

patch commited

Changed in fwts:
milestone: none → 14.06.00
status: In Progress → Fix Committed
Ivan Hu (ivan.hu)
Changed in fwts:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.