全部博文(75)
分类: LINUX
2009-05-21 10:14:56
Machine class idle function - arch_idle The arch_idle call is only called when the machine has no other process to run. Since the arch_idle call is both machine class and processor dependent, we call the machine class idle function, which will perform any specific idle functions, and which may or may not call call the cpu idle function. The idea is that if the CPU has some instructions to put it to sleep, then these go into the cpu idle function. If not, the cpu idle function should be empty, and the idle stuff goes into arch_idle (since its touching machine-specific registers). To give you an example, on machines which can have a StrongARM, we have the ability to slow down the processors clock. However, we don't just slow down the clock when we enter arch_idle, delay, speed it back up and then return since that would hurt the latency of the system. Instead, we wait a while to see if a process becomes runnable. If it does, we return immediately from arch_idle, thus preserving the low latency of the system. However, once 1/3 sec has expired, we slow the core clock and then use anything which provides us with a more "low-power" sleep, eg, wait-for-interrupt instruction. Once a process becomes runnable again, we speed the clock up again. As you can see, if the system is active, the processors clock will be running at high speed all the time, but if you get unactivity for 1/3 sec, then it starts dropping the processor clock speed and therefore conserving power. Obviously, if your machine has more processor clock rates/sleep options that would be useful, you could do a more fancy scheme here which could trade idle time vs power conservation. (eg, measure idle time and increase processor clock as idle time decreases). -- quote from http://www.arm.linux.org.uk/developer/kernelnotes.php |