`
yangzb
  • 浏览: 3502645 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

请您先登录,才能继续操作

HOWTO: CPU Frequency Scaling w/ Kernel Module

阅读更多

I thought I would write a little howto on how to get cpu frequency scaling to work directly with the kernel modules. These modules are generally more efficient for performance computing and battery life.

Prerequisites
kernel >= 2.6.9

Step 1: Enable BIOS Support
Enter your BIOS at boot and make sure Cool'n'Quiet (AMD) or SpeedStep (Intel) is enable for you CPU. Some BIOS may not have option at all. If that is the case it is probably enabled by default. Other BIOS may have the option but it is listed as another name altogether. If that is the case check your BIOS manual for more info.

Step 2: Remove Userspace Scaling Software
powernowd

Code:
sudo apt-get remove powernowd

cpudyn

Code:
sudo apt-get remove cpudyn

Step 3: Install CPU Module
Identify your cpu type by runnig the command

Code:
cat /proc/cpuinfo

You can also Check the following links
AMD CPU Chart - http://www.tomshardware.com/2005/11/...05/page20.html
Intel CPU Chart - http://www.tomshardware.com/2005/11/...05/page21.html

AMD Sempron/Athlon/MP ( K7 )
Socket Types: A, Slot A

Code:
sudo modprobe powernow-k7

AMD Duron/Sempron/Athlon/Opteron 64 ( K8 )
Socket Types: 754, 939, 940, S1 ( 638 ), AM2 ( 940 ), F ( 1207 )

Code:
sudo modprobe powernow-k8

Intel Core Duo

Code:
sudo modprobe speedstep-centrino

Intel Pentium M

Code:
sudo modprobe speedstep-centrino

Others (Unknown)
I'm not entirely sure which cpus are supported using this module. If your cpu doesn't work with one of the above methods try this one.

Code:
sudo modprobe acpi-cpufreq

Step 4: Scaling Modules

Code:
sudo modprobe cpufreq_conservative
sudo modprobe cpufreq_ondemand
sudo modprobe cpufreq_powersave
sudo modprobe cpufreq_stats
sudo modprobe cpufreq_userspace

Step 5: Testing/Configuration
Show Available Governors

Code:
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors

You should see output similar to

Code:
powersave conservative ondemand performance

conservative
Description: CPU frequency is scaled based on load in incremental steps up and down.

Code:
sudo -s
echo conservative > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

Advanced Configuration Options

Code:
cd /sys/devices/system/cpu/cpu0/cpufreq/conservative

ondemand
Description: CPU frequency is scaled based on load.

Code:
sudo -s
echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

Advanced Configuration Options

Code:
cd /sys/devices/system/cpu/cpu0/cpufreq/ondemand

performance
Description: CPU only runs at max frequency regardless of load.
Configuration Dir: N/A

Code:
sudo -s
echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

powersave
Description: CPU only runs at min frequency regardless of load.
Configuration Dir: N/A

Code:
sudo -s
echo powersave > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

Step 6: Load Modules at Boot
Add the following lines to the end of /etc/modules

Code:
cpufreq_conservative
cpufreq_ondemand
cpufreq_powersave
cpufreq_stats
cpufreq_userspace
[Module from Step 3]

Step 7: Configure Modules at Boot
This step needs to be done in order for the modules to retain your settings.
Make sure you have sysfsutils installed

Code:
sudo apt-get install sysfsutils

Then add the following lines to /etc/sysfs.conf

Code:
devices/system/cpu/cpu0/cpufreq/scaling_governor=ondemand

Where ondemand can be changed to another governor type (i.e. conservative, powersave, etc.). You can also add other configuration options that are specific to the governor selected.

Useful Links
http://ubuntu.wordpress.com/2005/11/...uency-scaling/
http://martin.ankerl.org/category/linux/
http://gentoo-wiki.com/HOWTO_Undervolt_a_Pentium_M_CPU
http://wejp.k.vu/projects/howto_cnq_athlon_64_x2/

分享到:
评论

相关推荐

    How to use CPU frequency scaling

    - 编辑`/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor`文件,设置为所选策略。 ##### 4.6 加载内核模块 - 使用`/etc/modules-load.d/cpufreq.conf`配置文件添加所需的模块名称。 - 使用`update-...

    MTK Android常用的命令记录(CPU-GPU频率调整等).pdf

    要查看CPU当前的工作频率,可以使用`cat`命令读取`/sys/devices/system/cpu/cpu*/cpufreq/scaling_cur_freq`目录下的文件。例如,`# cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_cur_freq`会显示出所有CPU...

    CPU-Freq开发设置.rar

    cat /sys/devices/system/cpu/cpu4/cpufreq/scaling_available_frequencies echo "userspace" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor echo "1416000" > /sys/devices/system/cpu/cpu0/cpufreq/...

    CVPR2024:用于野外逼真图像恢复的实用算法

    (CVPR2024) Scaling Up to Excellence: Practicing Model Scaling for Photo-Realistic Image Restoration In the Wild

    FS(Frequency scaling)成像算法仿真程序

    频率缩放(Frequency Scaling,FS)成像是SAR图像处理中的一种关键算法,其主要思想是调整回波信号的频谱特性,以适应不同的系统参数和成像需求。在条带模式的SAR系统中,由于目标距离的变化,雷达接收到的回波信号...

    Everything I Learned About Scaling Online Games I Learned at Google and eBay

    How to Scale - Scaling Code Embrace Open Source Embrace Standard Data Formats Development Discipline How to Scale - Scaling Infrastructure Layering Micro-Services Google Cloud Datastore Reactive ...

    全志平台Tina系统切频测试脚本

    #set CPU modle to userspace,set MAX frep to 1200M,set MIN frep to 60M echo userspace > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor echo 1200000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling...

    Data Algorithms: Recipes for Scaling Up with Hadoop and Spark pdf

    首先,从标题《Data Algorithms: Recipes for Scaling Up with Hadoop and Spark pdf》中我们可以得知,本书主要讲述了如何利用Hadoop和Spark技术来处理海量数据集。本书通过提供一系列“食谱”式的方法(recipes)...

    High Performance Spark: Best Practices for Scaling and Optimizing Apache Spark

    High Performance Spark: Best Practices for Scaling and Optimizing Apache Spark by Holden Karau English | 25 May 2017 | ASIN: B0725YT69J | 358 Pages | AZW3 | 3.09 MB Apache Spark is amazing when ...

    Linux系统的参数配置优化技巧

    通过`echo 268435456 >/proc/sys/kernel/shmall`和`echo 268435456 >/proc/sys/kernel/shmmax`,可以将内核共享内存限制设置为256MB,以支持更大规模的系统活动。 3. **可用代理端口范围**:设置`echo "1024 65000...

    Linux系统(X64)安装Oracle11g完整安装图文教程另附基本操作

    kernel.sem = 250 32000 100 128 fs.file-max = 65536 net.ipv4.ip_local_port_range = 9000 65500 net.core.rmem_max = 262144 net.core.wmem_max = 262144 net.core.netdev_max_backlog = 2000 ...

    SwiftCGRectExtensions.zip

    Operators for adding, scaling sizes, applying CGAffineTransform Shortcut properties for corner and center points Offsetting, insetting and extending methods with multiple ways of specifying ...

    Linux6.4安装Oracle11GR2

    这些软件包包括但不限于 binutils、compat-libstdc++-33、elfutils-libelf、elfutils-libelf-devel、gcc、gcc-c++、glibc-common、glibc、glibc-devel、glibc-headers、kernel-headers、ksh、libaio、libaio-devel、...

    Aseprite Quick Reference - Cheat Sheet.pdf

    * 正方形比率:⇧Square Aspect (when scaling) 刷子快捷键 * 新建自定义刷子:New custom brush * 保存 / 载入自定义刷子:⌘B * 切换刷子:⇧ 工具快捷键 * 矩形选择框:Rectangular Marquee * 椭圆选择框:...

    Scalability Rules: 50 Principles for Scaling Web Sites

    ### Scalability Rules: 50 Principles for Scaling Web Sites #### 书籍概述 《Scalability Rules: 50 Principles for Scaling Web Sites》是一本由Martin L. Abbott与Michael T. Fisher合著的专业书籍,旨在为...

    gentoo linux 的安装

    - CPU Frequency scaling - [ ] CPU frequency translation statistics - [X] Default CPU Freq governor (userspace) - **Networking support** - [ ] Wireless - [*] TCP/IP networking 4. **编译和安装...

Global site tag (gtag.js) - Google Analytics