EEE SHE and laptop-mode-tools adventures

Bug #906335 reported by Jacques
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
laptop-mode-tools (Ubuntu)
New
Undecided
Unassigned

Bug Description

Hi,

The installation of Linux on a brand new laptop is an incredible opportunity to waste a lot of time...especially for a unrecoverable geek like me. I had a strange behavior on my eeePC 1015PX with respect to power management and more particularly with ASUS's Super Hybrid Engine (SHE). After having tried the very ugly "Jupiter" (a software relying on mono...) I chose to let SHE be managed by laptop-mode-tools, a very nice and heavily customizable package that optimizes power management. I slightly modified "/etc/laptop-mode/conf.d/eee-superhe.conf" to point to the right "cpufv" file according to the new "eeepc-wmi" naming conventions :
SUPERHE_CONTROL_FILE=/sys/devices/platform/eeepc-wmi/cpufv

As I was using Matlab for doing intensive simulations, I noticed that, while on AC, my EEEPC was very slow. So I launched Matlab's "bench" command to perform some benchmarks and I was surprised to measure no noticeable difference between AC and Battery modes.

So I started some investigations. I suspected a bad interference between cpufreq and SHE. So I went in the /sys/devices/system/cpu/cpu0/cpufreq directory and did a "cat scaling_max_freq" while on AC. I obtained "1333000". On this platform it is not the maximum according to a "cat cpuinfo_max_freq" giving "1667000". So I had the cause of my issue. Now I had to find a fix. Before I need to find the cause of the cause. I observed that, while on battery and so with the SHE powersave mode engaged, doing an "echo 1667000 > scaling_max_freq" and after that an "cat scaling_max_freq" gave me "1333000" instead of "1667000". So when the SHE powersave mode (number 2) in selected, the maximum frequency is saturated. Then I looked at the order of activation of the laptop-mode-tools scripts in "/usr/share/laptop-mode-tools/modules". According to the main script in "/usr/sbin" it is simply the alphabetical order. So "cpufreq" is launched before "eee-superhe". And this is the core of the problem.

1 Plug in the power
2 cpufreq tries to configure "scaling_max_freq" at "1667000 Hz" but is saturated at "1333000 Hz" because there is still 2 in "/sys/devices/platform/eeepc-wmi/cpufv".
3 eee-superhe switches "sys/devices/platform/eeepc-wmi/cpufv" from 2 (powersave) to 0 (performance).

So this fix is very easy : only change the first letter of the "eee-superhe" script in order to be executed BEFORE "cpufreq".

sudo bash
cd /usr/share/laptop-mode-tools/modules
mv mv eee-superhe cp0_eee-superhe

Et voilà ! How to waste 2 hours ! I hope that this comment will save your time.

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.