Reduce Linux Power Consumption: general settings and tuning-related settings (1)

Source: Internet
Author: User

General settings of CPUfreq

We will first introduce the usage settings of the Linux CPUfreq subsystem and provide some Interface Options to see how easy it is to use. First, we will discuss some general settings:

/Sys Interface

Cpuspeed setting file

Cpufreq-utils

Use the/sys Interface

The/sys file system provides the user interface for CPUfreq, starting from/sys/devices/system/cpu /. Some of these files are writable by the root user) and other files are read-only.

First, check/sys/devices/system/cpu /. Here we will find the directory of each logical CPU and the sched_mc_power_savings adjustable item. If it is available on the system, we will also find the sched_smt_power_savings adjustable item to be discussed later ).

Listing 1. Check/sys/devices/system/cpu/Content

[Root @ systemx ~] # Cd/sys/devices/system/cpu/

[Root @ systemx cpu] # ls

Cpu0 cpu1 cpu2 cpu3 cpu4 cpu5 cpu6 cpu7 sched_mc_power_savings

There is a cpufreq directory in the directory of each processor, which contains the CPUfreq interface:

List 2. Check the cpufreq directory

[Root @ systemx cpu] # cd cpu0/cpufreq/

[Root @ systemx cpufreq] # ls-l

Total 0

-R -- 1 root 4096 Oct 31 14:53 affected_cpus

-R -------- 1 root 4096 Oct 31 cpuinfo_cur_freq

-R -- 1 root 4096 Oct 31 14:53 cpuinfo_max_freq

-R -- 1 root 4096 Oct 31 14:53 cpuinfo_min_freq

-R -- 1 root 4096 Oct 31 scaling_available_frequencies

-R -- 1 root 4096 Oct 31 14:53 scaling_available_governors

-R -- 1 root 4096 Oct 31 scaling_cur_freq

-R -- 1 root 4096 Oct 31 scaling_driver

-Rw-r -- 1 root 0 Nov 5 11: 44 scaling_governor

-Rw-r -- 1 root 4096 Oct 31 scaling_max_freq

-Rw-r -- 1 root 4096 Oct 31 scaling_min_freq

Join the Green Group on My developerWorks

On GReen IT Report space and My developerWorks, the Green computing group discusses topics related to energy, efficiency, and Environment and shares references.

If the Controller is set to conservative or ondemand, a directory with the same name as the controller is displayed here. We will discuss how to change the Controller later.

These files can be used for each controller. We will discuss the meaning of each setting and how to modify them. Then we will discuss some settings outside of this interface related to the Controller. Note: For each processor, the settings in the cpufreq directory can be different. Therefore, to apply consistent policies across processors, you must follow the instructions below to modify the setting values for each processor.

First, affected_cpus shows which processors will be affected by the modification frequency. Due to the Association of hardware and/or software, the frequency of some processors is mutually dependent and must be modified at the same time. For example, you may see this setting:

Listing 3. Check which processors will be affected by the modification frequency

[Root @ systemx ~] # Cd/sys/devices/system/cpu

[Root @ systemx cpu] # grep. cpu */cpufreq/affected_cpus

Cpu0/cpufreq/affected_cpus: 0 1

Cpu1/cpufreq/affected_cpus: 0 1

Cpu2/cpufreq/affected_cpus: 2 3

Cpu3/cpufreq/affected_cpus: 2 3

Then, cpuinfo_cur_freq displays the current operating frequency of the processor. The scaling_cur_freq file lists the extended frequencies currently used by the Controller.

Listing 4. Check frequency

[Root @ systemx cpufreq] # cat cpuinfo_cur_freq

2997000

[Root @ systemx cpufreq] # cat scaling_cur_freq

2997000

All frequencies listed in this interface are in KHz units.

The following files provide information about the available processor frequency. The cpuinfo_max_freq and cpuinfo_min_freq files contain the largest and least available system frequencies. scaling_available_frequencies displays all available frequencies.


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.