File:  [NetBSD Developer Wiki] / wikisrc / tutorials / cpu_frequency_scaling.mdwn
Revision 1.2: download - view: text, annotated - select for diffs
Sun Feb 5 07:14:36 2012 UTC (8 years ago) by schmonz
Branches: MAIN
CVS tags: HEAD
dos2unix

    1: How to throttle your CPU 
    2: 
    3: Basic support is in generic kernels by default. sysctl and sysutils/estd do the rest. 
    4: 
    5: **Contents**
    6: 
    7: [[!toc levels=3]]
    8: 
    9: #  i386 
   10: 
   11: ##  AMD PowerNow! 
   12:     
   13:       options 	POWERNOW_K7
   14:     
   15: 
   16: or 
   17:     
   18:       options 	POWERNOW_K8
   19:     
   20: 
   21: accessible through e.g. 
   22:     
   23:       sysctl machdep.powernow.frequency.current
   24:       sysctl machdep.powernow.frequency.available 
   25:       sysctl -w machdep.powernow.frequency.target=600
   26:     
   27: 
   28: ##  Intel Speedstep 
   29:     
   30:       options 	ENHANCED_SPEEDSTEP
   31:     
   32: 
   33: accessible through e.g. 
   34:     
   35:       sysctl machdep.est.frequency.current
   36:       sysctl machdep.est.frequency.available
   37:       sysctl -w machdep.est.frequency.target=600
   38:     
   39: 
   40: ##  speedstep-ich 
   41: 
   42:   * Available since NetBSD 2.0 
   43:     
   44:       ichlpcib* at pci? dev ? function ?
   45:       isa0 at ichlpcib?
   46:     
   47: 
   48: accessible through 
   49:     
   50:       sysctl -w machdep.speedstep_state=[0/1]
   51:     
   52: 
   53: where 0 is a low state and 1 is a high state. 
   54: 
   55: ##  speedstep-smi 
   56: 
   57:   * Available since NetBSD 4.0 
   58:     
   59:       piixpcib* at pci? dev ? function ?
   60:       isa0 at piixpcib?
   61:     
   62: 
   63: also accessible through 
   64:     
   65:       sysctl -w machdep.speedstep_state=[0/1]
   66:     
   67: 
   68: ##  Transmeta longrun 
   69: 
   70:   * Should be activated by default 
   71: 
   72: accessible through 
   73:     
   74:       machdep.tm_longrun_mode
   75:       machdep.tm_longrun_frequency
   76:       machdep.tm_longrun_voltage
   77:       machdep.tm_percentage
   78:     
   79: 
   80: #  amd64 
   81: 
   82: ##  Cool'n'Quiet 
   83: 
   84: Same procedure as with PowerNow!: 
   85:     
   86:       options 	POWERNOW_K8
   87:     
   88: 
   89: accessible through e.g. 
   90:     
   91:       sysctl machdep.powernow.frequency.current
   92:       sysctl machdep.powernow.frequency.available 
   93:       sysctl -w machdep.powernow.frequency.target=600
   94:     
   95: 
   96: #  Setting up estd for automatic scaling 
   97: 
   98: 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. 
   99:     
  100:       cd /usr/pkgsrc/sysutils/estd
  101:       make install clean
  102:     
  103: 
  104: To make it start at boot-time 
  105:     
  106:       cp /usr/pkg/share/examples/rc.d/estd /etc/rc.d/
  107:       chmod +x /etc/rc.d/estd
  108:     
  109: 
  110: and add to /etc/rc.conf 
  111:     
  112:       estd="yes"
  113:       estd_flags=""
  114:     
  115: 
  116: then as root 
  117:     
  118:       /etc/rc.d/estd restart
  119:     
  120: 
  121:   * Examples 
  122: 
  123: Maximize battery lifetime by limiting CPU-frequency to 1000 MHz and switching to lower speeds fast: 
  124:     
  125:       estd_flags="-d -b -M 1000"
  126:     
  127: 
  128: Maximize performance by running at least at 1400MHz and switching to higher speeds real fast: 
  129:     
  130:       estd_flags="-d -a -m 1400"
  131:     
  132: 
  133: Alternatively, you can start estd directly from /etc/rc.local instead of rc.conf/rc.d. 
  134: 
  135: More in the manual. 
  136: 

CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb