Package: laptop-mode-tools
Version: 1.57-1
Severity: normal

Hi,

Context: trying to have laptop-mode-tools automatically enable the
Turbo Boost feature on an Intel Core i5-560M CPU.

  $ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
  2667000 2666000 2533000 2399000 2266000 2133000 1999000 1866000 1733000 
1599000 1466000 1333000 1199000 

Every cpufreq governor defaults to setting scaling_max_freq to
2666000, i.e. the fastest except the special additional one (2667000)
that would enable Turbo Boost.

When using the performance governor, setting scaling_max_freq to the
special Turbo Boost -enabling frequency (2667000) enables the Turbo
Boost feature. This works nicely when done by hand, so I decided I
wanted laptop-mode-tools to do it automatically by setting these
options:

        LM_AC_CPU_MAXFREQ=2667000
        NOLM_AC_CPU_MAXFREQ=2667000

This did not work like intended, so I've dug a bit deeper. Note: all
following tests have been tried after killing gnome-power-manager and
upowerd, in case they might interfere.

When using one of the ondemand or conservative governors, setting
scaling_max_freq to the special Turbo Boost -enabling frequency has no
effect: scaling_max_freq is actually *not* changed at all. One may
argue this is actually a kernel, CPU, ACPI, BIOS, or whatever bug, but
I think that is orthogonal to the bug I am currently reporting: I'm
only explaining the needed bits of context.

When plugging the AC in, laptop-mode-tools' cpufreq module does (at
least) the following in order for every CPU (verified in verbose
mode):

  1. Set the new max. frequency.
  2. Set the new min. frequency.
  3. Set the new governor.

  => When the previous governor was ondemand or conservative, step #1 has
     no effect and the special Turbo Boost -enabling frequency is not
     set.

For this reason, I therefore suggest re-ordering the steps to:

  1. Set the new governor.
  2. Set the new max. frequency.
  3. Set the new min. frequency.

  => the new max. frequency is not set either.

The only way I had the whole thing working like intended was:

  1. Set the new governor.
  2. sleep 1
  3. Set the new max. frequency.
  4. Set the new min. frequency.

I have not checked the kernel documentation, but I doubt we can expect
the governor change to always happen immediately => inserting a small
delay like I did seems a bit ugly, but somehow needed.

What do you think?

-- System Information:
Debian Release: 6.0
  APT prefers squeeze-updates
  APT policy: (990, 'squeeze-updates'), (990, 'stable'), (2, 'testing'), (1, 
'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-5-amd64 (SMP w/4 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages laptop-mode-tools depends on:
ii  lsb-base                3.2-23.2squeeze1 Linux Standard Base 3.2 init scrip
ii  psmisc                  22.11-1          utilities that use the proc file s
ii  util-linux              2.17.2-9         Miscellaneous system utilities

Versions of packages laptop-mode-tools recommends:
ii  acpid                         1:2.0.7-1  Advanced Configuration and Power I
ii  apmd                          3.2.2-14   Utilities for Advanced Power Manag
ii  ethtool                       1:2.6.34-3 display or change Ethernet device 
pn  hal                           <none>     (no description available)
ii  hdparm                        9.32-1     tune hard disk parameters for high
ii  net-tools                     1.60-23    The NET-3 networking toolkit
ii  sdparm                        1.02-1     Output and modify SCSI device para
ii  udev                          164-3      /dev/ and hotplug management daemo
ii  wireless-tools                30~pre9-5  Tools for manipulating Linux Wirel

laptop-mode-tools suggests no packages.

-- Configuration Files:
/etc/laptop-mode/conf.d/cpufreq.conf changed:
DEBUG=0
CONTROL_CPU_FREQUENCY="auto"
BATT_CPU_MAXFREQ=fastest
BATT_CPU_MINFREQ=slowest
BATT_CPU_GOVERNOR=ondemand
BATT_CPU_IGNORE_NICE_LOAD=1
LM_AC_CPU_MAXFREQ=2667000
LM_AC_CPU_MINFREQ=slowest
LM_AC_CPU_GOVERNOR=performance
LM_AC_CPU_IGNORE_NICE_LOAD=0
NOLM_AC_CPU_MAXFREQ=2667000
NOLM_AC_CPU_MINFREQ=slowest
NOLM_AC_CPU_GOVERNOR=performance
NOLM_AC_CPU_IGNORE_NICE_LOAD=0
CONTROL_CPU_THROTTLING=0
BATT_CPU_THROTTLING=medium
LM_AC_CPU_THROTTLING=medium
NOLM_AC_CPU_THROTTLING=minimum

/etc/laptop-mode/laptop-mode.conf changed:
ENABLE_LAPTOP_MODE_TOOLS=1
VERBOSE_OUTPUT=1
LOG_TO_SYSLOG=1
DEBUG=0
ENABLE_LAPTOP_MODE_ON_BATTERY=1
ENABLE_LAPTOP_MODE_ON_AC=0
ENABLE_LAPTOP_MODE_WHEN_LID_CLOSED=0
ENABLE_AUTO_MODULES=1
MINIMUM_BATTERY_CHARGE_PERCENT=3
DISABLE_LAPTOP_MODE_ON_CRITICAL_BATTERY_LEVEL=1
HD="/dev/[hs]d[abcdefgh]"
PARTITIONS="auto /dev/mapper/*"
ASSUME_SCSI_IS_SATA=1
LM_BATT_MAX_LOST_WORK_SECONDS=600
LM_AC_MAX_LOST_WORK_SECONDS=360
CONTROL_READAHEAD=1
LM_READAHEAD=3072
NOLM_READAHEAD=128
CONTROL_NOATIME=0
USE_RELATIME=1
CONTROL_HD_IDLE_TIMEOUT=1
LM_AC_HD_IDLE_TIMEOUT_SECONDS=20
LM_BATT_HD_IDLE_TIMEOUT_SECONDS=20
NOLM_HD_IDLE_TIMEOUT_SECONDS=7200
CONTROL_HD_POWERMGMT="auto"
BATT_HD_POWERMGMT=1
LM_AC_HD_POWERMGMT=254
NOLM_AC_HD_POWERMGMT=254
CONTROL_HD_WRITECACHE=0
NOLM_AC_HD_WRITECACHE=1
NOLM_BATT_HD_WRITECACHE=0
LM_HD_WRITECACHE=0
CONTROL_MOUNT_OPTIONS=1
LM_DIRTY_RATIO=60
NOLM_DIRTY_RATIO=40
LM_DIRTY_BACKGROUND_RATIO=1
NOLM_DIRTY_BACKGROUND_RATIO=10
DEF_UPDATE=5
DEF_XFS_AGE_BUFFER=15
DEF_XFS_SYNC_INTERVAL=30
DEF_XFS_BUFD_INTERVAL=1
DEF_MAX_AGE=30
XFS_HZ=100
LM_SECONDS_BEFORE_SYNC=2


-- no debconf information

--
  intrigeri <intrig...@boum.org>
  | GnuPG key @ https://gaffer.ptitcanardnoir.org/intrigeri/intrigeri.asc
  | OTR fingerprint @ https://gaffer.ptitcanardnoir.org/intrigeri/otr.asc
  | Did you exchange a walk on part in the war
  | for a lead role in the cage?



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to