Skip to contentSkip to conversation

New: CPU freqs stay stuck at max after reboot with on-demand governor set

Bug 50721 [email protected] 2 participants 20 messages Nov 19, 2012 – Apr 13, 2013

lore
Share & tools
lore
#0 lore raw

https://bugzilla.kernel.org/show_bug.cgi?id=50721

Summary: CPU freqs stay stuck at max after reboot with
on-demand governor set
Product: Power Management
Version: 2.5
Kernel Version: 3.7-rc6
Platform: All
OS/Version: Linux
Tree: Mainline
Status: NEW
Severity: normal
Priority: P1
Component: cpufreq
AssignedTo: [email protected]
ReportedBy: [email protected]
Regression: Yes

Created an attachment (id=86591)
--> (https://bugzilla.kernel.org/attachment.cgi?id=86591)
/proc/cpuinfo

With 3.7-rc5 and -rc6 sometimes (often?) after a reboot my PC's cores (on an i7-2630QM) all remaing running at 2GHz, even after their governors are changed to ondemand (this is done by the /etc/init.d/ondemand script approximately one minute after it runs at boot). I'm not running anything especially taxing at this stage, just a Ubuntu unity desktop that is idling away.

Note that when this happens, /proc/cpuinfo incorrectly indicates that the cores are running are 800MHz (does the ondemand governor use this to determine if it needs to change speed?) but that this disagrees with the readings from powertop, cpufreq-info and (eg) /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq.

In /sys/devices/system/cpu/cpu0/cpufreq/, scaling_governor indicates ondemand is being used, and cpuinfo_min_freq is 800000. powertop indicates power usage of 35W (compared to a more normal 22W), and acpi -t shows 75C instead of the more normal 45-55C.

Changing the governor to performance and back again doesn't help, but a suspend/resume cycle seems to fix it.

I'll attach the output from cat /proc/cpuinfo and cpufreq-info when the problem is being exhibited.

Signature · 3 lines
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
#1 lore raw

[Bug 50721] CPU freqs stay stuck at max after reboot with on-demand governor set

https://bugzilla.kernel.org/show_bug.cgi?id=50721

--- Comment #1 from rocko <[email protected]> 2012-11-19 05:45:46 --- Created an attachment (id=86601)
--> (https://bugzilla.kernel.org/attachment.cgi?id=86601)
cpufreq-info output

Signature · 3 lines
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
#2 lore raw

[Bug 50721] CPU freqs stay stuck at max after reboot with on-demand governor set - i7-2630QM

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=50721

Len Brown <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

             Status|NEW                         |NEEDINFO
                 CC|                            |[email protected]
            Summary|CPU freqs stay stuck at max |CPU freqs stay stuck at max
                   |after reboot with on-demand |after reboot with on-demand
                   |governor set                |governor set - i7-2630QM

--- Comment #2 from Len Brown <[email protected]> 2012-11-20 02:56:40 --- please show the output from turbostat
when this problem is happening.
you can find turbostat in the kernel source tree under tools/power/x86/turbostat

also, please verify with top that nothing is running when the system is idle.

Signature · 3 lines
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
#3 lore raw

[Bug 50721] CPU freqs stay stuck at max after reboot with on-demand governor set - i7-2630QM

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=50721

--- Comment #3 from rocko <[email protected]> 2012-11-20 23:30:06 --- I definitely verified with top that nothing was using significant CPU the last time this happened. I'll try running turbostat next time I see it (it doesn't happen on every reboot).

Signature · 3 lines
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
#4 lore raw

[Bug 50721] CPU freqs stay stuck at max after reboot with on-demand governor set - i7-2630QM

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=50721

--- Comment #4 from rocko <[email protected]> 2012-11-24 01:11:16 --- Created an attachment (id=87151)
--> (https://bugzilla.kernel.org/attachment.cgi?id=87151)
Log output from turbostat and other commands

Here's the output from turbostat, top, and cpuinfo after I booted the system and the cores stayed stuck in max frequency. I also included the output from turbostat after a suspend/resume cycle, when the cores had successfully clocked down to their min frequencies.

One point of strangeness is that first turbostat indicates frequencies up to 2.45GHz, which I thought is higher than my system allows. The subsequent turbostat shows the cores running at around 2GHz. I suppose it is possible that I ran the first command while the system was still using the performance governor - could this be why the cores report 2.45GHz? The second turbostat definitely was running when the ondemand governor was running, as you can see from the 800Mhz reported in cpuinfo, and my frequency applet also was reporting that the system was running in low performance mode.

Signature · 3 lines
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
#5 lore raw

[Bug 50721] CPU freqs stay stuck at max after reboot with on-demand governor set - i7-2630QM

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=50721

--- Comment #5 from Len Brown <[email protected]> 2012-11-27 02:52:31 ---
re: /proc/cpuinfo MHz value

I don't think that is used for anything, or means anything. We really should delete that, as all it does is confuse people.

re: turbostat output

yes, it looks like you are stuck at high frequency even when mostly idle, but this condition goes away after suspend/resume. Does the system behave normally after it breaks out of the initial problem?

Signature · 3 lines
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
#6 lore raw

[Bug 50721] CPU freqs stay stuck at max after reboot with on-demand governor set - i7-2630QM

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=50721

--- Comment #6 from rocko <[email protected]> 2012-11-27 03:43:45 ---

Quoted 1 line

re: /proc/cpuinfo MHz value

Yes, it surely must confuse people! I found several sites recommending it. Additionally, when my system isn't experiencing this bug, it does seem to be accurate.

Quoted 1 line

Does the system behave normally after it breaks out of the initial problem?

Yes, after suspend/resume the system works just fine, as far as I can tell.

Signature · 3 lines
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
#7 lore raw

[Bug 50721] CPU freqs stay stuck at max after reboot with on-demand governor set - i7-2630QM

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=50721

--- Comment #7 from rocko <[email protected]> 2012-12-03 03:14:23 --- This is still a problem in 3.7-rc7. Is there any other info I can provide or things I can try?

Signature · 3 lines
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
#8 lore raw

[Bug 50721] CPU freqs stay stuck at max after reboot with on-demand governor set - i7-2630QM

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=50721

--- Comment #8 from rocko <[email protected]> 2012-12-04 01:01:43 --- Created an attachment (id=88361)
--> (https://bugzilla.kernel.org/attachment.cgi?id=88361)
turbostat after boot showing too-high GHz readings

This is still a problem in 3.7-rc8.

I ran turbostat (log attached) just after reboot, before the governor tried to drop the frequency down to lowest (in fact the governor dropped to ondemand just before the last reading in the log). Here turbostat also reports frequency readings are also over my CPU's max of 2.0GHz (up to 2.6 GHz in some cases). Does that mean that turbostat is also providing unreliable information? The cores are definitely running at a higher frequency, because the fan goes on high and the power usage is right up.

Signature · 3 lines
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
#9 lore raw

[Bug 50721] CPU freqs stay stuck at max after reboot with on-demand governor set - i7-2630QM

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=50721

--- Comment #9 from rocko <[email protected]> 2012-12-23 14:47:57 --- I've just encountered this again in kernel 3.7.1.

turbostat indicates the cores are running over their max 2.0GHz frequency (it says core 1 in particular is running at up to 2.4GHz).

Is there anything I can try that might help to debug this?

Signature · 3 lines
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
#10 lore raw

[Bug 50721] CPU freqs stay stuck at max after reboot with on-demand governor set - i7-2630QM

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=50721

--- Comment #10 from Len Brown <[email protected]> 2013-01-08 03:01:37 --- turbostat -v will tell you the max turbo for this processor. Yes, it is normal to run above the TSC frequency --
indeed, that is exactly what turbo-mode is for...

can you force the processors to go slower by writing to sysfs?

eg. as root
cd /sys/devices/system/cpu/cpu0/cpufreq

cat scaling_max_freq
cat scaling_min_freq > scaling_max_freq
cat scaling_max_freq

and see if you can get that cpu to slow down, as shown by turbostat.

Signature · 3 lines
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
#11 lore raw

[Bug 50721] CPU freqs stay stuck at max after reboot with on-demand governor set - i7-2630QM

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=50721

--- Comment #11 from rocko <[email protected]> 2013-01-14 01:26:38 --- No, the command doesn't work. I ran into the issue again with 3.7.2, and although the command does set scaling_max_frequency to equal scaling_min_frequency, turbostat still shows the core running at a much higher frequency:

root@sierra:/sys/devices/system/cpu/cpu0/cpufreq# cat scaling_min_freq  >
scaling_max_freq 
root@sierra:/sys/devices/system/cpu/cpu0/cpufreq# cat scaling_max_freq 
800000
root@sierra:/sys/devices/system/cpu/cpu0/cpufreq# turbostat 
cor CPU    %c0  GHz  TSC    %c1    %c3    %c6    %c7   %pc2   %pc3   %pc6  
%pc7
          0.54 2.04 1.99   0.99   0.04   0.00  98.44   0.00   0.00   0.00  
0.00
  0   0   1.09 2.00 1.99   0.78   0.06   0.00  98.06   0.00   0.00   0.00  
0.00
  0   1   0.04 1.99 1.99   1.83
  1   2   0.52 2.00 1.99   0.38   0.00   0.00  99.10
  1   3   0.08 1.99 1.99   0.81
  2   4   1.14 2.17 1.99   0.26   0.01   0.00  98.59
  2   5   0.01 1.99 1.99   1.39
  3   6   1.42 1.99 1.99   0.51   0.07   0.00  98.00
  3   7   0.01 2.00 1.99   1.91

cor CPU %c0 GHz TSC %c1 %c3 %c6 %c7 %pc2 %pc3 %pc6
%pc7

          0.31 2.01 1.99   0.70   0.02   0.00  98.97   0.00   0.00   0.00  
0.00
  0   0   0.92 1.99 1.99   0.68   0.03   0.00  98.37   0.00   0.00   0.00  
0.00
  0   1   0.02 1.99 1.99   1.58
  1   2   0.27 1.99 1.99   0.36   0.00   0.00  99.37
  1   3   0.10 1.99 1.99   0.53
  2   4   0.57 2.05 1.99   0.15   0.01   0.00  99.27
  2   5   0.01 2.00 1.99   0.71
  3   6   0.47 1.99 1.99   0.64   0.02   0.00  98.87
  3   7   0.12 1.99 1.99   0.99
Signature · 3 lines
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
#12 lore raw

[Bug 50721] CPU freqs stay stuck at max after reboot with on-demand governor set - i7-2630QM

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=50721

--- Comment #12 from rocko <[email protected]> 2013-01-14 01:30:37 --- On a positive note, I haven't encountered this issue yet at all on the 3.8-rc kernel series.

Signature · 3 lines
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
#13 lore raw

Re: [Bug 50721] CPU freqs stay stuck at max after reboot with on-demand governor set - i7-2630QM

i also experience this exactly, with i7-2720QM.
my cores get 'stuck' on 2.2ghz
sometimes, the max w/out turbo.
{kernel 3.7.0, lenovo w520}

cpu usage hovers around 6% and load is .62. the cores spend nearly all their time in C7 state, according to turbostat.

changing the governor does not fix this.
using userspace or ondemand and setting
the min/max can convince to use turbo {2201000, goes to 3.1ghz}, but not change the minimum.
performance makes it use turbo {goes to 3.1ghz},
and powersave does nothing {keeps it at 2.2ghz}.

note that suspending to ram and waking up, occasionally shakes it loose, and freq drops to 0.8ghz. so when it gets stuck, as a workaround, i just pm-suspend, wait 20s, and repeat, until turbostat shows it has dropped.

#14 lore raw

[Bug 50721] CPU freqs stay stuck at max after reboot with on-demand governor set - i7-2630QM

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=50721

Klaus Meier <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |[email protected]

--- Comment #13 from Klaus Meier <[email protected]> 2013-01-22 10:53:14 --- Starting with kernel 3.7.0 i have no frequency scaling with m AMD Phenon. Thereist no folder /sys/bus/cpu/devices/cpu0/cpufreq

Signature · 3 lines
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
#15 lore raw

[Bug 50721] CPU freqs stay stuck at max after reboot with on-demand governor set - i7-2630QM

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=50721

Vadim Fint <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |[email protected]

--- Comment #14 from Vadim Fint <[email protected]> 2013-03-14 16:07:16 --- Got absolutely the same behaviour with 3.7.5 kernel on i7-2620M cpu. As far as I can see -- it occurs after long sleeps > 5-10 mins. I occurs 100% after long sleep (going to work -- it happens, going home at evening -- it happens again).

cpufreq shows what it sets lowest freq possibly, but once I try "-w" switch it shows 2.7GHz real hardware clock.

I tried plain vanilla 3.7.10 kernel with no luck.

Cant try 3.8.x yet, because there is no pf-patches for it (I *need* BFS ;)).

Will try to downgrade onto 3.6.x and post results here...

Cpufreq from unprivileged user shows 800MHz:

csl linux/tools/power/x86/turbostat # sudo -u mocksoul cpufreq-info| grep 'curre
nt CPU'
current CPU frequency is 800 MHz.
current CPU frequency is 800 MHz.
current CPU frequency is 800 MHz.
current CPU frequency is 800 MHz.

While root can read hw freq and it shows 2.7GHz :(
mcsl linux/tools/power/x86/turbostat # cpufreq-info| grep 'current CPU'
current CPU frequency is 2.70 GHz (asserted by call to hardware). current CPU frequency is 2.70 GHz (asserted by call to hardware). current CPU frequency is 2.70 GHz (asserted by call to hardware). current CPU frequency is 2.70 GHz (asserted by call to hardware).

Turbostat (as well as powertop 1.x) shows that my cpu mostly in c7 state:

mcsl linux/tools/power/x86/turbostat # ./turbostat
cor CPU %c0 GHz TSC %c1 %c3 %c6 %c7 %pc2 %pc3 %pc6
%pc7

          0.42 2.69 2.69   1.34   0.03   0.00  98.22   0.00   0.00   0.00  

0.00

0 0 0.86 2.69 2.69 2.41 0.05 0.00 96.67 0.00 0.00 0.00
0.00

  0   1   0.63 2.69 2.69   2.64
  1   2   0.15 2.69 2.69   0.09   0.00   0.00  99.76
  1   3   0.02 2.69 2.69   0.22
Signature · 3 lines
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
#16 lore raw

[Bug 50721] CPU freqs stay stuck at max after reboot with on-demand governor set - i7-2630QM

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=50721

--- Comment #15 from Vadim Fint <[email protected]> 2013-03-18 17:18:53 --- Yep, in 3.6.12 kernel I have no issues anymore!

Signature · 3 lines
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
#17 lore raw

[Bug 50721] CPU freqs stay stuck at max after reboot with on-demand governor set - i7-2630QM

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=50721

--- Comment #16 from rocko <[email protected]> 2013-03-24 22:09:48 --- I just encountered this again on 3.9-rc4 but this time after a resume rather than a reboot. All eight cores were stuck at 2.00GHz. Suspending and resuming again made them drop back to the more normal 0.8GHz.

This bug is marked as needinfo. What more info is required?

Signature · 3 lines
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
#18 lore raw

[Bug 50721] CPU freqs stay stuck at max after reboot with on-demand governor set - i7-2630QM

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=50721

Viresh Kumar <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |[email protected]

--- Comment #17 from Viresh Kumar <[email protected]> 2013-03-25 02:56:34 --- (In reply to comment #16)

Quoted 1 line

All eight cores were stuck at 2.00GHz.

This is probably a new bug, try following patch:

https://lkml.org/lkml/2013/3/24/164

Signature · 3 lines
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
#19 lore raw

[Bug 50721] CPU freqs stay stuck at max after reboot with on-demand governor set - i7-2630QM

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=50721

Zhang Rui <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

                 CC|                            |[email protected]
         AssignedTo|[email protected]     |[email protected]
Signature · 3 lines
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.