cpufreq scaling_grovernor only saved for CPU0 on SMP following suspend/resume.

Bug #78512 reported by Bart Samwel
2
Affects Status Importance Assigned to Milestone
acpi-support (Ubuntu)
Confirmed
Wishlist
Unassigned
powernowd (Ubuntu)
Invalid
Medium
Unassigned

Bug Description

I have a Dell Inspiron 9400 with a Core 2 Duo (2 GHz). When I suspend and then resume it, the second core frequency scaling is reset.

Here's a test case. Start with cpu0 for comparison:

$ cd /sys/devices/system/cpu/cpu0/cpufreq
$ cat scaling_governor
ondemand

[suspend and resume now]

$ cat scaling_governor
ondemand

Now reboot (or restart powernowd!) and try again with cpu1:

$ cd /sys/devices/system/cpu/cpu1/cpufreq
$ cat scaling_governor
ondemand

[suspend and resume now]

$ cat scaling_governor
cat: scaling_governor: No such file or directory
$ cd ../cpufreq
$ cat scaling_governor
performance

So the cpu1 directory remains, but the cpufreq directory completely disappears, and is recreated over resume with new, default settings. The "hackish" solution is to restart powernowd after resume, but I guess the real solution lies in the kernel.

Revision history for this message
Brian Murray (brian-murray) wrote :

Thanks for your bug report. With which version of Ubuntu and the kernel did you notice this? Thanks in advance.

Revision history for this message
Bart Samwel (bart-samwel) wrote :

It was on an rc for 2.6.20. I don't know exactly which one, probably rc3. I'll have to check if it's still a problem -- I'll get back to you on this when I have some time tonight!

Revision history for this message
Kristoffer Paro (kristoffer-paro) wrote :

I experience the exact same behavior with my Core Duo 2GHz Fujitsu-Siemens Lifebook. I run Ubuntu 6.10 with the 2.6.17-11-generic kernel.

Tim Gardner (timg-tpi)
Changed in linux-source-2.6.20:
assignee: nobody → timg-tpi
Revision history for this message
gilbert (rizo83) wrote :

Same deal happens in Edgy x86 on a Thinkpad T60p and Feisty x86 on a Uniwill X20II1 (both have Core2 Duo) when suspend-to-disk. My fix is to append the following to /etc/acpi/resume.d/69-services.sh after #!/bin/sh

# fix for second core scaling
echo ondemand > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor

No need to restart powernowd or echo ondemand to the scaling_governor file on resume from suspend.

Changed in linux-source-2.6.20:
assignee: timg-tpi → nobody
importance: Undecided → Medium
Revision history for this message
Paul Sladen (sladen) wrote :

There's a couple of options here.

  (a) have the kernel remember the choice (already does for the first CPU)
  (b) hack around and save this value in 'acpi-support'

Ideally the kernel should be doing this. 'powernowd' isn't run these days as a daemon, only an 'init.d' script to choose 'ondemand' and to load the appropriate modules.

Changed in acpi-support:
importance: Undecided → Wishlist
Revision history for this message
Paul Sladen (sladen) wrote :

Could you with multi-CPU machines please post the output from:

  $ grep . /sys/devices/system/cpu/cpu*/cpufreq/scaling_[dg]*

before and after a suspend/resume cycle.

And if you have time, also after a hibernate/resume cycle.

Many Thanks, -Paul

Revision history for this message
Paul Sladen (sladen) wrote :

<BenC> sladen: I just confirmed that problem on my core2duo workstation
<BenC> cpu1 reverted to performance
<BenC> cpu0 is at ondemand

Changed in acpi-support:
status: Unconfirmed → Rejected
Revision history for this message
Ben Collins (ben-collins) wrote :

Looks like the policy for this cpu is getting dropped during the suspend. Not sure if this is multi-core related, or just SMP in general.

I can reproduce it, so I'll check into the issue.

Changed in linux-source-2.6.20:
assignee: nobody → ben-collins
status: Confirmed → In Progress
Revision history for this message
Ben Collins (ben-collins) wrote :

This is going to have to be fixed in userspace. The reason we lose the cpufreq state is because on suspend, the kernel hot unplugs the CPU, thus losing all referenced to it.

Userspace is going to need to respond to hot plug/unplug of cpu's and restore things like governor and frequency. Probably can do this with some udev rules, and remove the need for the init script all together. Maybe the init/udev scripts could check of cpu hotplug is enabled, and act accordingly (use init when it isn't supported and udev scripts when it is).

Changed in linux-source-2.6.20:
assignee: ben-collins → nobody
status: In Progress → Confirmed
Revision history for this message
Paul Sladen (sladen) wrote :

In the long-run, CPU hotplug seems to the way to fix this (that way the correct modules can also be loaded at that point). For the moment I think I'll fix it in 'acpi-support' by having the suspend and resume scripts save the scaling-governor during suspend/resume; in reality *everything* under that directory really needs saving.

Changed in powernowd:
status: Confirmed → Rejected
Changed in acpi-support:
status: Rejected → Confirmed
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.