In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
How to analyze the failure cases caused by SUSE Linux's CPU power saving mode, many novices are not very clear about this. In order to help you solve this problem, the following editor will explain it in detail. People with this need can come and learn. I hope you can get something.
A SUSE Linux10 server on the production system suddenly lost its response after midnight, and the remote connection could not be logged in. The resident engineer was arranged to have a look at the computer room and found that all kinds of lights on the server were normal and the network cable was not loose. When connected to the keyboard and mouse, the field engineer found that the server did not respond, the keyboard and mouse did not respond, and the server seemed to be frozen dormant. Because this server is a member of the load balancing server group, it does not affect the business even if it is offline. So I asked the field engineer to restart the server and found that everything was fine after rebooting. After collecting the logs, I found that there was an error code as follows:
According to the English hint: CPU does not support frequency adjustment, you need to set 'CPUFREQ_ENABLED=no' and SUSPEND2RAM_FORCE=yes.
Analysis: now the CPU of the server consumes a lot of power, so adjusting CPU frequency on demand is of great significance for energy saving. At present, most Linux distributions have enabled this feature by default, but some LINUX distributions need to go through simple settings (enable relevant modules and install CPU frequency adjustment program). In fact, the power-saving mode of CPU, that is, frequency conversion technology, CPU will automatically reduce the frequency when the load is not high. The driver of cpufreq is used to dynamically adjust the CPU frequency to reduce energy consumption. However, this feature sometimes has problems, such as when you do not have the corresponding module and frequency adjustment driver, it will cause kernel errors and cause the server to fail to respond.
We can take a look at the module drivers that support CPU frequency adjustment in the system.
# cd / lib/modules/2.6.16.60-0.21-smp/kernel/arch/x86_64/kernel/cpufreq
Web132:/lib/modules/2.6.16.60-0.21-smp/kernel/arch/x86_64/kernel/cpufreq # ls-l
Total 104
-rw-r--r-- 1 root root 30264 May 6 2008 acpi-cpufreq.ko
-rw-r--r-- 1 root root 37808 May 6 2008 powernow-k8.ko
-rw-r--r-- 1 root root 29544 May 6 2008 speedstep-centrino.ko
Loading method
# modprobe acpi-cpufreq
# modprobe powernow-k8
# modprobe speedstep-centrino
In this failure case, there is no cpufreq driver available, so the solution
# vi / etc/powersave/cpufreq
CPUFREQ_ENABLED= "no" (note: default is yes)
Restart / etc/init.d/powersave and it will take effect.
You can query the cpu frequency status by using the command cpufreq-info
# cpufreq-info
Cpufrequtils 0.4: cpufreq-info (C) Dominik Brodowski 2004
Report errors and bugs to linux@brodo.de, please.
Analyzing CPU 0:
No or unknown cpufreq driver is active on this CPU
Analyzing CPU 1:
No or unknown cpufreq driver is active on this CPU
Analyzing CPU 2:
No or unknown cpufreq driver is active on this CPU
Analyzing CPU 3:
No or unknown cpufreq driver is active on this CPU
As shown above, the status display after CPU frequency adjustment is turned off.
If your CPU supports frequency adjustment, the system will display
# cpufreq-info
Cpufrequtils 0.4: cpufreq-info (C) Dominik Brodowski 2004
Report errors and bugs to linux@brodo.de, please.
Analyzing CPU 0:
Driver: centrino
CPUs which need to switch frequency at the same time: 0
Hardware limits: 1.20 GHz-2.50 GHz
Available frequency steps: 2.50 GHz, 2.00 GHz, 1.60 GHz, 1.20 GHz
Available cpufreq governors: ondemand, userspace, powersave, performance
Current policy: frequency should be within 1.20 GHz and 2.50 GHz.
The governor "ondemand" may decide which speed to use
Within this range.
Current CPU frequency is 1.20 GHz (asserted by call to hardware).
Analyzing CPU 1:
Driver: centrino
CPUs which need to switch frequency at the same time: 1
Hardware limits: 1.20 GHz-2.50 GHz
Available frequency steps: 2.50 GHz, 2.00 GHz, 1.60 GHz, 1.20 GHz
Available cpufreq governors: ondemand, userspace, powersave, performance
Current policy: frequency should be within 1.20 GHz and 2.50 GHz.
The governor "ondemand" may decide which speed to use
Within this range.
Current CPU frequency is 1.20 GHz (asserted by call to hardware).
Analyzing CPU 2:
Driver: centrino
CPUs which need to switch frequency at the same time: 1
Hardware limits: 1.20 GHz-2.50 GHz
Available frequency steps: 2.50 GHz, 2.00 GHz, 1.60 GHz, 1.20 GHz
Available cpufreq governors: ondemand, userspace, powersave, performance
Current policy: frequency should be within 1.20 GHz and 2.50 GHz.
The governor "ondemand" may decide which speed to use
Within this range.
Current CPU frequency is 1.20 GHz (asserted by call to hardware).
Analyzing CPU 3:
Driver: centrino
CPUs which need to switch frequency at the same time: 1
Hardware limits: 1.20 GHz-2.50 GHz
Available frequency steps: 2.50 GHz, 2.00 GHz, 1.60 GHz, 1.20 GHz
Available cpufreq governors: ondemand, userspace, powersave, performance
Current policy: frequency should be within 1.20 GHz and 2.50 GHz.
The governor "ondemand" may decide which speed to use
Within this range.
Current CPU frequency is 1.20 GHz (asserted by call to hardware).
Next, modify
# vi / etc/powersave/sleep
SUSPEND2RAM_FORCE= "yes"
# / etc/init.d/powersaved restart
Through the above modifications, the problem is solved.
Supplement cpufreq technology:
Five strategies are built into cpufreq: performance, powersave, userspace, ondemand,
Conservation . Ondemand policy is used by default, in which cpu utilization is collected every 80 milliseconds.
At the same time, it is assumed that the cpu usage is the same before and after. The latter cpu usage is introduced through the previous cpu utilization.
And then set the frequency. So in terms of general thinking, it is not difficult to understand.
Objective:
Frequency conversion technology means that the CPU hardware itself supports running at different frequencies, and the system can be run at any time according to the
The load of the system that can change dynamically switches between these different operating frequencies, thus achieving performance and
Power consumption to achieve the purpose of both.
Source:
Although many processor manufacturers have provided support for frequency conversion technology, its hardware implementation and usage are bound to exist.
In subtle or even huge differences. This makes it necessary for each processor manufacturer to follow its special hardware implementation and
Use the method to add code to the kernel so that the frequency conversion technology in your product can be supported and used in Linux
. However, the consequence of this kernel development mode is that the implementation code of various manufacturers is scattered in the Linux kernel code.
In all corners of the tree, no code is shared between different implementations, which gives the kernel maintenance and the future
Adding support for new products brings huge overhead and directly leads to the birth of cpufreq kernel subsystems.
Management strategy:
There are five frequency management strategies within Linux userspace,conservative,ondemand,powersave
And performance
1.performance: CPU will work at the highest operating frequency it supports.
2.powersave: CPU will always work at the lowest operating frequency it supports. So these two kinds
Governors are static governor, that is, the frequency of CPU will not run according to the system when using them.
The change of load is adjusted dynamically. These two governors correspond to two extreme application scenarios, using the
Performance governor embodies the greatest pursuit of high performance of the system, while using powersave governor
Is the greatest pursuit of low power consumption of the system.
3.Userspace: the earliest cpufreq subsystem provides users with userspace governor
This flexibility. The system gives the decision-making power of the frequency conversion strategy to the user-mode application program, and provides the corresponding interface for use.
Household applications are used to adjust the running frequency of CPU. (cpufrequtils can be developed by Dominik et al.
Toolkit)
4.ondemand: userspace is the detection of kernel state, and its efficiency is low. And ondemand is exactly what people have long regarded as
To expect to see a fully kernel state working and be able to load the system at a finer time interval
Governor for sampling and analysis. Choose the maximum main frequency when the CPU is loaded, and one step when the CPU is idle
Step down.
5.conservative: the initial implementation of ondemand governor is to lower it within an optional frequency range.
To the next available frequency. That is, to increase or decrease the frequency according to the use of CPU, the main idea of this frequency reduction strategy is to reduce as much as possible.
Small negative impact on system performance, so that the system performance will not be rapidly reduced in a short period of time to affect the user experience.
But after this initial implementation of ondemand governor was released in the community, a large number of users used the result table
In fact, this worry is superfluous. Ondemand governor can choose the target frequency when reducing the frequency.
To be more radical. Therefore, the latest ondemand governor will choose one time among all the optional frequencies when lowering the frequency.
The frequency at which the CPU can be guaranteed to work at more than 80% of the load, of course, if no optional frequency meets the requirements.
The lowest running frequency supported by CPU is selected. The test results of a large number of users show that the new algorithm can be used in the
Achieve more efficient energy saving without affecting the performance of the system. After the algorithm is improved, the name of ondemand governor
The word has not changed, and the original implementation of ondemand governor has been preserved, and due to the preservation of its algorithm
It is named conservative because of its conservatism.
Ondemand frequency reduction is more radical, conservative frequency reduction is slow and conservative, in fact, the effect of using ondemand is also
It's better. Unlike the ondemand manager, when the CPU load is high, conservative
Instead of jumping directly to the highest dominant frequency, it uses a step-by-step way to increase the dominant frequency.
The interface that Cpufreq presents in user mode:
Cpuinfo_max_freq cpuinfo_min_freq: the maximum operation supported by CPU hardware is given respectively.
Frequency and minimum operating frequency
Cpuinfo_cur_freq reads the current running frequency of CPU from the CPU hardware register.
When choosing the appropriate running frequency, Governor will only run on scaling_max_freq and
Select within the frequency range determined by scaling_min_freq
Scaling_cur_freq returns the current running frequency of the CPU cached by the cpufreq module, and does not set the
Check the CPU hardware register.
Scaling_available_governors will tell the user which governors is currently available.
Scaling_driver will display the variable frequency driver used by the CPU.
Scaling_governor will show the current management policy, and other types of echo will have corresponding
Change.
Scaling_setspeed: you need to switch the governor type to userspace before it appears. Go to this file
Echo value, which will switch the main frequency.
1.
Run the command: echo userspace >
/ sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
Put the system into userspace mode, and then you can manually modify the frequency of CPU with the following command:
Echo freq_val > / sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed
Where freq_val is the CPU frequency value to be set, in KHz units, for example, 336000 represents 336MHz. Freq_val 's
The range of values is 36000 to 400000. If the value of freq_val is not an integer multiple of 12000, after running this command, CPU
The frequency will be set to the frequency that is closest to freq_val, but is an integral multiple of 12MHz.
two。 Run the command: echo conservative >
/ sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
Put the system into conservative mode and the CPU frequency will gradually decrease to the minimum 36MHz.
3. Run the command: echo powersave >
/ sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
If you put the system into powersave mode, the CPU frequency will be directly reduced to the minimum 36MHz.
4. Run the command: echo performance >
/ sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
Put the system into performance mode and the CPU frequency will rise directly to the maximum 396MHz.
CPU and serial port frequency conversion, when the CPU frequency conversion, send PRECHANGE notice to the driver, after the serial port receives the notice, send the contents of the FIFO first, and then prohibit FIFO; and then CPU to do the frequency conversion related changes, and then send the POSTCHANGE notice after the change; the serial port receives the notice and re-counts the baud rate with a new clock to enable FIFO.
Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.