Linux Tuning CPU Frequency

Source: Internet
Author: User

Cd/sys/devices/system/cpu/cpu0/cpufreq Cat Scaling_available_governors

HotPlug Conservative OnDemand Userspace PowerSave interactive performance

In order to be able to several common CPU frequency regulation mode has a basic understanding of the following simple summed up according to the characteristics of different ways to do in the performance and power-saving between the two contradictions make a choice to find the right balance point

1, ondemand system default overclocking mode on-demand adjustment The kernel provides the function is not very powerful but effectively realizes the dynamic frequency regulation usually runs at low speed when the system load increases automatically increases the frequency. Running in this mode does not degrade performance due to reduced frequency, but also saves power and lowers temperature. The general official kernel and the CM7 default way are OnDemand.
Fluency is generally smooth

2, interactive interactive mode directly on the highest frequency then look at the CPU load slowly lower compared to power consumption.
Maximum fluency and fluency
Interactive is the number of CPU scheduling to adjust the frequency so that the power saving Interactivex is CPU load to adjust the CPU frequency will not overshoot the frequency. So it's better than Interactive, but the power-saving effect is generally

3, conservative conservative mode is similar to OnDemand but adjust relatively slowly want to save electricity use him. Google's official kernel Kang kernel default mode.
High fluency and smoothness of flow

4, Smartass Smart mode is I and C mode upgrade This mode will be more power-saving under the condition that the model is not poor in response to I mode
Fluency is the most fluid

5, performance performance mode only the highest frequency never consider the consumption of electricity performance without saying but power consumption ....
fluency still need to say is there more fluid than this mode?

6, PowerSave power saving mode is usually run at the lowest frequency I don't need to kill.
Very low flow level

7. The userspace user-defined mode system gives the decision-making power of the frequency conversion strategy to the user-State application and provides the corresponding interface for the user-State application to adjust the CPU operating frequency usage. That's the pattern that's been used for a long time. Can be configured by manually editing the configuration file
Smoothness varies by setting

8. HotPlug is similar to OnDemand, but the CPU will try to turn off a CPU under off and have deep sleep to compare power saving.
Fluency is generally smooth

PS settings including SETCPU) of the CPU Frequency regulation mode is based on the system used by the kernel and the method described above does not necessarily have

Objective

Now the CPU consumes a lot of power. Adjusting CPU frequency on demand has important meaning for energy saving most Linux distributions now have this feature enabled by default, but Debian 4.0 and ArchLinux do not have to be easily set up.

The Debian 4.0 and ArchLinux Kernels have compiled modules that regulate the CPU frequency but are not enabled by default so to do is to enable the relevant modules and install the CPU frequency adjuster program is optional.

Select and enable the kernel module that corresponds to the CPU

To ensure that the next work is meaningful, first make sure that your CPU frequency tuning function is not enabled ~

# cd/sys/devices/system/cpu/cpu0# Ls-l

If you see a folder named Cpufreq, it means that the frequency adjustment feature is enabled you can skip to the next step directly.

If you don't see a folder named Cpufreq, look at the driver you can use first

# ls/lib/modules/' Uname-r '/kernel/arch/*/kernel/cpu/cpufreq

What I see in My computer is the same as your estimate.

Acpi-cpufreq.ko Longrun.ko Powernow-k8.ko Speedstep-smi.kocpufreq-nforce2.ko P4-clockmod.ko Speedstep-centrino.kogx-suspmod.ko Powernow-k6.ko Speedstep-ich.kolonghaul.ko Powernow-k7.ko Speedstep-lib.ko

These are optional drivers but are matched to different CPUs. Commonly used is the

P4-clockmod.ko Intel P4 Processors Speed-centrino.ko Many notebooks are the Acpi-cpufreq.ko of this Powernow-k*.ko AMD processor. OK, try this. but 2.6.20 or above the kernel recommended priority to use the item

The above table lists only the common ones if not try the others.

The way to try is

1. Load the kernel module as

#modprobe P4-clockmod

And AS

#modprobe Powernow-k8

Note that the module name is to remove the file name above. Ko.

2. If there is no error message, you are right. If you want to make sure to look

# cd/sys/devices/system/cpu/cpu0# Ls-l

Whether there is cpufreq.

Tips
You can use cat to see the files under the Cpufreq folder to get some useful information Select the appropriate regulator

The regulator is governor used to control the CPU frequency. Optional, there are

Kernel module Regulator name function Cpufreq_ondemand OnDemand On Demand the function provided by the kernel is not very powerful but the dynamic frequency regulation Cpufreq_powersave is implemented effectively powersave Power-down mode typically runs at the lowest frequency cpufreq_userspace Userspace user mode Some FM tool software requires this mode to run Cpufreq_conservative conservative "conservative" Mode is similar to OnDemand but adjusts relatively slowly n/a performance does not reduce frequency

View the current regulator

# Cat/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

Changing the regulator used requires loading the appropriate kernel module and then changing the Scaling_governor file for example

# Modprobe cpufreq_conservative# echo Conservative >/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

Attention
If the use of the CPU is older using SPEEDSTEP-SMI as a dynamic frequency module can not use OnDemand and other real-time FM software because of its long FM delay.

Of course, you can also use Gnome's tools to adjust, see the introduction to the rear.

Using software to manage CPU frequency

The CPU frequency management of kernel modules is already very powerful. Of course you can also apply software to manage optional software that has

    1. Cpudynd

    2. Cpufreqd

    3. Cpufrequtils

    4. Powernowd

    5. Powersaved

    6. Speedfreqd

There are some of these sources, but I don't think they're very good. The cpuspeed in Fedora is better but not in the source.

Using Gnome's CPU frequency range monitor

Right-click on the Gnome panel to select "Add to Panel" to join "CPU frequency range monitor". Right-click Preferences on that icon to choose how to display and speed up. Normal user cannot adjust CPU frequency by default to solve this problem, see provide CPU FM permissions for normal users .

set boot automatically load above settings Debian 4.0

1. Edit/etc/modules Add the kernel module that was mounted just modprobe

Cpufreq-userspace
Cpufreq-ondemand
Cpufreq-powersave
Cpufreq-conservative
Speedstep-centrino #请修改为相应的频率调节模块

2. Installing Sysfsutils

#apt-get Install Sysfsutils

Edit/etc/sysfs.conf file contents with Superuser privileges

Devices/system/cpu/cpu0/cpufreq/scaling_governor = OnDemand
Devices/system/cpu/cpu0/cpufreq/scaling_max_freq = 1800000 #请修改为您的CPU的最高频率

If the dual-core CPU should also join the CPU1 content is exactly similar to the cpu0. This operation is not required for multithreaded CPUs.

ArchLinux

    • Add the kernel module just modeprobe mounted in the modules variable of/etc/rc.conf

Cpufreq-userspace
Cpufreq-ondemand
Cpufreq-powersave
Cpufreq-conservative
Speedstep-centrino #请修改为相应的频率调节模块

    • Cpudyn and Acpid can be installed and

#/etc/rc.d/cpudyn start#/etc/rc.d/acpid Start

Starting auto-tuning can also be added to the rc.conf to allow it to start automatically.

Adjusting the CPU operating mode

1, adjust the overall working mode

CPUFREQ-SET-G Performance

2, manual No. 0 core of the specified maximum frequency and minimum frequency

Cpufreq-set-c 0-g userspace-d 180000-u 240000

How to use commands

Usage:cpufreq-set [Options] Options:

-C CPU,--CPU CPU #指定CPU核心号请注意的analyzing CPU number.

-D FREQ,--min FREQ #手工指定最小主频速度. In the userspace policy

-U FREQ,--max FREQ #手工指定最大主频速度. In the userspace policy

-G gov,--governor gov #设置工作策略

-F FREQ,--freq FREQ #设定特定的工作频率CPU默认档次

#请参考的available Frequency steps

-H,--help #输出这个帮助信息


Vim/etc/sysconfig/cpuspeed

Modify GOVERNOR to Governor=performance

/etc/init.d/cpuspeed restart


This article from "11726068" blog, declined reprint!

Linux Tuning CPU Frequency

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.