Linux Power Management for x86 CPU (1)---- C-State
http://blog.sina.com.cn/s/blog_7014a5340100mv7m.htmlLinux Power Management for x86 CPU (1)---- C-State------------------------------------------------Modern CPUs are more and more powerful.
·
http://blog.sina.com.cn/s/blog_7014a5340100mv7m.html
Linux Power Management for x86 CPU
Modern CPUs are more and more powerful. When there is no job to do, it
enters into idle state. During its ilde period, we certainly can cut
Linux Power Management for x86 CPU
------------------------------------------------
Modern CPUs are more and more powerful. When there is no job to do, it
enters into idle state. During its ilde period, we certainly can cut
off its power and have it enter into low-power state only if we know
when there is new assignment and we can re-activate CPU and have it do
its jobs again. The process is like this:
To achieve the above goal, we need to answer the following questions:
1.
-----------------
The answer to the first question is very simple as a matter of fact: When
it is idle, CPU runs the swapper process (process ID is 0. Pobably, it
should be called idle thread, anyway, it is a legacy name, and all text-
books call it that way). So, CPU must be idle when it runs into swapper.
Traditionally, the swapper process does nothing. In a forever loop, it just
checks if there is other task to do, if not, delays for a while and then
checks again, otherwise, it tells process scheduler to schedule other task.
The code is like like this: