CLASS="sect1" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" >

12.3. CPU

You may find a survey about CPUs used in mobile devices, which are Linux-supported in the chapter Chapter 1 Which Laptop to Buy? above.

12.3.1. SpeedStep

Speedstep is a feature of recent CPUs made by Intel, which lets you set CPU frequency. There are different Linux tools to get this to work. Similar features are also available for other CPUs from AMD or the StrongARM CPU, I will describe this in a later issue (assistance welcome).

Before configuring SpeedStep have a look into the BIOS options.

12.3.1.1. SpeedStep Tool

The SpeedStep tool works with Mobile Pentium-III CPUs only. See output from cat /proc/cpuinfo:

   model name : Intel(R) Pentium(R) III Mobile CPU 1000MHz
It does not work with the mobile version of the Pentium-III:

   model name : Pentium III (Coppermine)

12.3.1.2. CPUFREQ

You might want to check into the cpufreq patch for the linux-2.4/2.5 kernels: CPU clock frequency scaling for Linux, on x86 and ARM based processors. This module provides a user-space and standard kernel-space interface to this feature, along ARM system-on-a-chip devices to cope with processor clock changes. Since the power consumed by a processor is directly related to the speed at which it is running, keeping the clock speed as low as possible allows you to get more run-time out of your battery. Some people use this to adjust their clock speed many times a second to optimise performance vs battery life. See also the CVS repository .

12.3.1.2.1. cpufreqd

cpufreqd is meant to be a replacement of the speedstep applet you can find on some other operating systems, it monitors battery level, AC state and running programs and adjusts the frequency governor according to a set of rules specified in the config file. It works both with APM and ACPI.

12.3.1.2.2. cpudyn

cpudyn controls the speed in Intel SpeedStep and PowerPC machines with the cpufreq compiled in the kernel. It saves battery and lowers temperature, without affecting the performance of interactive applications.

12.3.1.2.3. cpuspeedy

cpuspeedy allows you to change the clock speed and voltage of CPUs using Linux's CPUFreq driver. It is a user space program, so it will work on every processor supported by the kernel's CPUFreq driver.

12.3.1.2.4. powernowd

PowerNowd is a simple client daemon for the Linux cpufreq driver using the sysfs interface. It sits in the background and changes CPU speed in configurable "steps" according to usage. Written in C, its emphasis is on speed and simplicity. It is very configurable, and supports non-x86 and SMP systems.

12.3.1.3. Laptop Mode

Laptop mode is a kernel "mode" that allows you to extend the battery life of your laptop. It does this by intelligently grouping write activity on your disks, so that only reads of uncached data result in a disk spinup. It has been reported to cause a significant improvement in battery life (for usage patterns that allow it).

The Laptop Mode Tools package spins down your hard drive like noflushd, but it works also on journalling filesystems. It integrates with apmd/acpid/pbbuttonsd to enable this behaviour only when you are running on battery power. It also adjusts some hdparm settings and remounts your filesystems noatime, and it can adjust your maximum CPU frequency.

12.3.1.4. SONY VAIO SPIC Daemon

The SONY VAIO SPIC daemon is a fast and small hack to create a working apmd to Sony VAIO laptops. It uses the sonypi kernel module to detect the AC adapter status and the LCD backlight, and cpufreq for CPU frequency scaling.

12.3.1.5. CPUIDLE

A software utility that will make your CPU run cooler? Sounds pretty strange, huh? Let me explain: Have you ever thought of the fact that your CPU is idle most of the time when you're using your computer? For example, when you're using your word processor, writing emails, browsing the web, the CPU does nothing else than just wait for user input. In fact, it will use up to 30W and produce substantial amounts of heat doing nothing. Good operating systems, like Linux, NT and OS/2 have a so-called "idle loop" - a loop that's always executed when the CPU has nothing to do. This loop consists of halt (HLT) instructions. CPUs like the AMD K6, the Cyrix 6x86 and 6x86MX have a special feature called "suspend-on-halt". This means that everytime the CPU executes a hlt instruction, it will go into "suspend mode" for a short time. So, while the idle loop is being executed, the CPU will be in suspend mode, use much less power, and stay much cooler. Of course, this does not affect performance at all! The user won't even notice that his CPU is in suspend mode most of the time (unless he touches the heatsink).

12.3.1.6. ACPI

If you have enabled ACPI support in the Kernel you may also set the SpeedStep parameters via the /proc/apci/ interface, e.g. echo 1 > /proc/acpi/processor/CPU0/performance will make the CPU speed down. Note: the spaces in the command are important! Note also: this feature is deprecated for Kernel > 2.6.11. Or use this script provided by Sebastian Henschel.

#! /bin/sh

# /etc/init.d/slowcpu: slow down cpu or accelerate it via speedstep

test -e /proc/acpi/processor/CPU0/performance || exit 0

case "$1" in
    start)
    echo "Setting CPU0-Speed to: 733 MHz."
    echo 1 > /proc/acpi/processor/CPU0/performance
	;;
    stop)
    echo "Setting CPU0-Speed to: 1133 MHz."
    echo 0 > /proc/acpi/processor/CPU0/performance
	;;
    force-reload|restart)
	;;

    *)
	echo "Usage: $0 {start|stop}"
	exit 1
esac

exit 0