How to throttle your CPU

Basic support is in generic kernels by default. sysctl and sysutils/estd do the rest.

Contents

  1. i386
    1. AMD PowerNow!
    2. Intel Speedstep
    3. speedstep-ich
    4. speedstep-smi
    5. Transmeta longrun
  2. amd64
    1. Cool'n'Quiet
  3. Setting up estd for automatic scaling

i386

AMD PowerNow!

  options   POWERNOW_K7

or

  options   POWERNOW_K8

accessible through e.g.

  sysctl machdep.powernow.frequency.current
  sysctl machdep.powernow.frequency.available 
  sysctl -w machdep.powernow.frequency.target=600

Intel Speedstep

  options   ENHANCED_SPEEDSTEP

accessible through e.g.

  sysctl machdep.est.frequency.current
  sysctl machdep.est.frequency.available
  sysctl -w machdep.est.frequency.target=600

speedstep-ich

accessible through

  sysctl -w machdep.speedstep_state=[0/1]

where 0 is a low state and 1 is a high state.

speedstep-smi

also accessible through

  sysctl -w machdep.speedstep_state=[0/1]

Transmeta longrun

accessible through

  machdep.tm_longrun_mode
  machdep.tm_longrun_frequency
  machdep.tm_longrun_voltage
  machdep.tm_percentage

amd64

Cool'n'Quiet

Same procedure as with PowerNow!:

  options   POWERNOW_K8

accessible through e.g.

  sysctl machdep.powernow.frequency.current
  sysctl machdep.powernow.frequency.available 
  sysctl -w machdep.powernow.frequency.target=600

Setting up estd for automatic scaling

The estd daemon dynamically sets the frequency on SpeedStep and PowerNow!-enabled CPUs depending on current CPU-utilization. It is written for systems running NetBSD or DragonFly.

  cd /usr/pkgsrc/sysutils/estd
  make install clean

To make it start at boot-time

  cp /usr/pkg/share/examples/rc.d/estd /etc/rc.d/
  chmod +x /etc/rc.d/estd

and add to /etc/rc.conf

  estd="yes"
  estd_flags=""

then as root

  /etc/rc.d/estd restart

Maximize battery lifetime by limiting CPU-frequency to 1000 MHz and switching to lower speeds fast:

  estd_flags="-d -b -M 1000"

Maximize performance by running at least at 1400MHz and switching to higher speeds real fast:

  estd_flags="-d -a -m 1400"

Alternatively, you can start estd directly from /etc/rc.local instead of rc.conf/rc.d.

More in the manual.