views:

43

answers:

1

I am confused with the CPU idle time is set to 99. Does this mean the CPU is idle not doing anything for 99% of the time?

#vmstate
procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
 0  0   2336  18512 263972 1048992   0    0    1     47   0    0  0  0  99  0  0
+2  A: 

Yes.

This is a result of the fundamental design of operating systems.

This might be an inaccurate analogy, but think of it as an endless loop. When your processes finish before the scheduled slot it is assigned, and does not need additional slots, most of the work done by the CPU, is OS related wait-for-action loop.

In micro controllers, where you usually don't have an operating system, you'd indeed use endless loops for constantly checking interrupts or pins for a state and then action on them. If nothing happens, the controller spends most of its time checking the state, and not actually acting on it.

polemon