Enhanced SpeedStep driver for FreeBSD

Intel Pentium M processors have circuitry for changing their clock frequency and input voltage on-the-fly. In addition to providing a large range of frequencies -- typically between 5 and 7, in contrast to earlier processors from Intel, which only had "fast" and "slow" speeds -- this "Enhanced SpeedStep" is easier to control, requiring only that a MSR (model-specific register) be manipulated, unlike earlier versions which required BIOS support.

A FreeBSD kernel module for controlling this is available here with MD5 hash 82fb0e28c61f6cf1d037c38883a6a7ff and in the ports tree as sysutils/est. I recommend using the port rather than building by hand.

This driver creates two sysctls: hw.est_freqs is a (read-only) list of the available frequencies, while hw.est_curfreq is a read/write variable containing the speed in MHz.

A couple notes are in order:

  1. This code will refuse to run if you have multiple processors. (I don't know of any Pentium M based multiprocessor systems, so I don't think this is a major limitation.)
  2. This code will refuse to run if it does not recognize your processor as supporting Enhanced Speedstep. Please contact me if you have a processor which supports Enhanced Speedstep but is not recognized by my code. (Note that a "Pentium 4 - M" processor is not a Pentium M, and does not support Enhanced Speedstep.)

In most cases, it is desirable to adjust the CPU frequency based on the current CPU load. One simple tool for this purpose is available here with MD5 hash d43ed67c75d2763b2ca93653ad4af7aa and in the ports tree as sysutils/estctrl; it uses the kern.cp_time sysctl to determine current load twice each second, and adjusts the processor frequency accordingly.

In addition to changing frequency based on the cpu load, estctrl can change the frequency based upon power source (AC or battery); it takes command-line options of "-a mode" and "-b mode" for controlling behaviour when on AC power and battery power respectively, where "mode" is one of "min", "max", and "adaptive". (If the port is used, these modes can be specified via the estctrl_speed_ac and estctrl_speed_battery rc.conf variables.)

On my Dell D600 laptop, running with Enhanced SpeedStep and estctrl increases battery life by roughly 35-40%, with no noticeable change in performance (since it accelerates to maximum speed within a few seconds of starting anything cpu-intensive).

Please send any comments by email to cperciva at (this domain).