Friday 27 November 2009

Laptop Mode Tools - program which you have to have

There are many laptop power saving managers, I tested a lot of them but only one meet my expectations, which isn't so strict. This manager or rather set of a tools is of course Laptop Mode Tools, its posibilities are incredible, it takes care whole your hardware and software, you need to only fit configuration to your requirements. All configuration files are located in path:
/etc/laptop-mode
Directory contains following files/directories:
  • laptop-mode.conf  - main, most important configuration file
  • lm-profiler.conf - configuration file of lm-profiler tool, lm-profiler detects processes that use system resources and that cause activity of hard disc drive and help disable them
  • batt-start, batt-stop - directories containing scripts which will be executed depend on battery mode is starts or stops
  • lm-ac-start, lm-ac-stop - directories containing scripts which will be executed in case AC mode starts or stops and laptop-mode management is active during working on AC
  • nolm-ac-start, nolm-ac-stop - ame as above, but in case laptop-mode management is inactive during working on AC
  • conf.d - directory containing additional configuration files targeted to special parts of system like ethernet card, lcd brightness, auto hibernate, kernel schedulers etc.
All configuration files are very well commented, of course remember to add/enable init script of laptop-mode to a runlevel.

Advantages of Laptop Mode Tools:
  • automaticaty detection AC or battery power source
  • decreased hdd's usage (data read ahead and buffering data designed to write on a hdd)
  • data loss protection
  • you decide about each option, nothing is imposed on you
  • default configuration is effective
  • laptop-mode-tools manage everything, so you need no more programs
Disadvantages of Laptop Mode Tools:
  • CPU frequency management, this is only function having better substitution. I recomend Cpufreqd which is more flexible
http://samwel.tk/laptop_mode/   -  Link to Laptop Mode Tools project

Friday 13 November 2009

rmmod or modprobe?

Usually when we use our laptop, we needn't all resources working (for example we connect to Internet or local net via WIFI card or Ethernet card or modem but not all of them together), nevertheless operating system sets them ready to work. That means there are spend power necessary to run device even it isn't used, obviously nowadays most of hardware supports power save modes reducing power consumption, but there is no reason to turn on something which won't be used. Important requirements to manipulate hardware are:
  • drivers should be compiled as kernel modules
  • enabled option of loading and unloading modules 
If you use default kernel everything is done, but if you compile kernel with your own configuration, remember about above requirements.

OK, let's profit extra minutes working on battery.

To turn off the device we use following command (as root user):
rmmod < name of module >

Of course if we want running device back, command loading module is:
modprobe < name of module >

What we may turn off:
  • Wireless card
  • Ethernet card
  • Modem
  • USB device
  • Sound card and speakers
  • Web camera
  • Optical disc drive (like DVD-R/RW, CD-R/RW etc.)
  • many other
Research:
Hardware:       Wireless card Realtek RTL8187B
Mean Value:    WIFI on = 16.0396      WIFI off = 14.1703

As you see I profit almost 2 Watts when I am unload WIFI driver. I want to mention that wireless card wasn't connected.

How unloading kernel's modules affect power consumption