no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
| — | cpufreq [2013/04/10 17:03] (current) – created - external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ======= cpufreq ======= | ||
| + | ===== Synopsis ====== | ||
| + | < | ||
| + | ====== Intro ====== | ||
| + | |||
| + | < | ||
| + | |||
| + | ====== cpufreq ====== | ||
| + | |||
| + | To control the cpustate you need to load the [[http:// | ||
| + | NOTE: You cannot load kernel modules if in securelevel 1 or above, see below on how to enable the kernel module on the next reboot. | ||
| + | |||
| + | You can check if the module is loaded by using the kldstat utility | ||
| + | |||
| + | Output of kldstat should be something like this. | ||
| + | |||
| + | < | ||
| + | Id Refs Address | ||
| + | | ||
| + | | ||
| + | </ | ||
| + | |||
| + | This will however only work until the next reboot, so you want to add the following line to / | ||
| + | < | ||
| + | cpufreq_load=" | ||
| + | </ | ||
| + | |||
| + | This will allow you to view and set the CPU Frequency manually. | ||
| + | |||
| + | This is done via the following sysctl' | ||
| + | |||
| + | | dev.cpu.n.freq | The Current CPU Frequency in MHz ((n is the CPU number (starting at 0))). | ||
| + | | dev.cpu.n.freq_levels | CPU Frequency levels available in MHz/mW ((milliwatts)). | | ||
| + | |||
| + | On some systems the latter part may be -1 for undefined. | ||
| + | ====== Sample ====== | ||
| + | |||
| + | Pentium 4 2.8 GHz | ||
| + | < | ||
| + | $ sysctl dev.cpu.0.freq dev.cpu.0.freq_levels | ||
| + | dev.cpu.0.freq: | ||
| + | dev.cpu.0.freq_levels: | ||
| + | </ | ||
| + | |||
| + | ====== Setting CPU speed ====== | ||
| + | |||
| + | dev.cpu.0.freq can be used to view and/or set the current CPU speed, to view the cpuspeed just run sysctl dev.cpu.0.freq, | ||
| + | |||
| + | ====== Using powerd ====== | ||
| + | |||
| + | You can use powerd(8) to control the CPU speed automatically, | ||
| + | |||
| + | insert the following line into ''/ | ||
| + | <file txt rc.conf> | ||
| + | powerd_enable=" | ||
| + | </ | ||
| + | |||
| + | Next, run ''/ | ||
| + | Example: | ||
| + | |||
| + | < | ||
| + | # ps -ax |grep powerd | ||
| + | | ||
| + | </ | ||
| + | |||
| + | ====== Verifying the CPU Speed ====== | ||
| + | |||
| + | You can now see the CPU speed constantly changing with the load of the machine by monitoring dev.cpu.n.freq sysctl. | ||