What is busy when the CPU is idle

Source: Internet
Author: User
Tags cpu usage

GitHub version: Https://github.com/cncounter/translation/blob/master/tiemao_2014/CPUIdel/CPUIdel.md


The CPU is doing nothing for most of the time. Most technical experts know this fact, but we haven't discussed it in detail about how the CPU switches from idle to working and then back to idle. This mechanism becomes increasingly important for modern processors; One of the goals of today's chip design is to switch the processor to a low-power state as quickly as possible.

A detailed article written by Gustavo Duarte states that when the CPU is idle (idle CPU) It is not doing anything (doing nothing)--it is running idle tasks. The overall design of the CPU is to return to the idle state as quickly as possible after completing the current operation, but the system must have some way/way to wake the chip and let it focus on something else. One way to do this is to use a system timer.

[Image source: Gustavo Duarte]

As described in Duarte, one way to prevent the CPU from consuming too much power is to have a longer clock cycle (tick periods) built in. In this way, the CPU needs to spend a longer amount of free time before waking up, then performing basic tasks and then sleeping again. What is an idle task?

Idle tasks may sound a bit paradoxical. The point is that you have to understand that since the CPU is powered on, it has to be running all the time, even if he doesn't do anything right. The philosophical equivalent of the term "busy waiting" (busy waiting), essentially allows the CPU to constantly calculate a condition to see if it is true.

For Windows running on the x86 chip, this feature is represented as a pause (HLT) instruction, corresponding to the Windows System Idle process. Windows only calls the idle idle process to run when a CPU core does not have the appropriate thread to perform. If you look at the task manager of the Windows system, you will see that the System Idle process (idle processes) Most of the time displays a higher percentage of CPU usage. Unlike other processes in the process list, the higher the value of the idle process, the smaller the amount of work that represents the CPU. The purpose of the HLT directive is to minimize power consumption and to bring the CPU into power-saving mode/state.

The history of HLT

The HLT (pause) command has a long history-it was implemented on the first 8086 processor, but it was not supported by earlier operating systems. Old programmers may remember that there was a time when even the basic HLT functionality always failed to perform as expected. Looking back on the overclocking years, the CPU had a basic tool (utility) called rain, which actually increased the idle idle time of the CPU (as well as the heat dissipation and power consumption during processing). As time goes by, we can see that hardware manufacturers and software developers are becoming more and more complex.

This is one aspect of Windows 8 innovation--well, it's essentially just trying to innovate--but it has some weird results. By default it allows for longer intervals during processing, but it also causes problems with programs such as Google Chrome, which automatically sets the clock frequency (tick rate) to the minimum allowed by the operating system in order to respond more quickly to user actions. This bug has been fixed in the new version of the program, but may still reduce the battery life of some Windows 8 computers.

An Intel 8086 CPU for 1978 years. Indeed, the CPU was a very simple thing--about 20,000 transistors.

This is indeed a place where you can adjust the clock cycle, plus to support systems that do not have a crystal-based timer, to make Microsoft unprepared. In Windows8, the software adjusts the speed of the front-end bus by mixing the operating system's time records, which results in incorrect benchmark tests. This behavior is maintained in [Windows 10], although it is only a minor problem-you have to adjust the clock of the system's front-end bus when the operating system produces the wrong results.

The original blog is mainly about desktop operating systems, Race-to-idle is a key component of modern CPU architecture. AMD and Intel release a new generation of products every year, and they often roll out updates, which may only be a little higher in performance, but with better clock gating (clocking gating), they can significantly increase energy usage and enable faster power-saving mode switching.

Extended reading: How disk drives (hard disks) work

Original link: What does a CPU does when it's doing nothing?

Original Date: 2014-11-07

Translation Date: 2014-11-10

Translators: Anchor

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.