djwhitt.com/blog

CPU Frequency Scaling

without comments

I just setup CPU frequency scaling in Gentoo on my Thinkpad T61p (Intel Core 2 Duo). These are the steps I followed:

  1. Enable relevant kernel modules/options:
    #
    # CPU Frequency scaling
    #
    CONFIG_CPU_FREQ=y
    CONFIG_CPU_FREQ_TABLE=m
    CONFIG_CPU_FREQ_DEBUG=y
    CONFIG_CPU_FREQ_STAT=m
    # CONFIG_CPU_FREQ_STAT_DETAILS is not set
    CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
    # CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
    # CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
    # CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
    CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
    CONFIG_CPU_FREQ_GOV_POWERSAVE=m
    CONFIG_CPU_FREQ_GOV_USERSPACE=m
    CONFIG_CPU_FREQ_GOV_ONDEMAND=m
    CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m

    #
    # CPUFreq processor drivers
    #
    CONFIG_X86_ACPI_CPUFREQ=m
    # CONFIG_X86_POWERNOW_K8 is not set
    # CONFIG_X86_SPEEDSTEP_CENTRINO is not set
    # CONFIG_X86_P4_CLOCKMOD is not set

    Screenshot linux kernel CPU frequency scaling menuconfig on my T61p

  2. Add the appropriate modules to /etc/modules.autoload.d/kernel-2.6 so that they are loaded at boot time:
    # cpu frequency scaling
    acpi-cpufreq
    cpufreq_ondemand
  3. Install cpufrequtils:
    emerge cpufrequtils
  4. Set CPU frequency governor in /etc/conf.d/cpufrequtils:
    # /etc/conf.d/cpufrequtils: config file for /etc/init.d/cpufrequtils
    # Which governor to use. Must be one of the governors listed in:
    # cat /sys/devices/system/cpu/cpu?/cpufreq/scaling_available_governors
    #
    GOVERNOR="ondemand"
  5. Add cpufrequtils to boot runlevel:
    rc-update add cpufrequtils boot
  6. Reboot (or start the stuff by hand) and enjoy a more efficient system.

Written by djwhitt

June 3rd, 2008 at 11:44 pm

Posted in Gentoo, Linux, Meta, Ruby, T61p

Leave a Reply