3 ms·
How does this work on a single-CPU system? Wouldn’t the various idle checks and governor calls keep the CPU always busy? Or is there some way to turn off someth
by cobbzilla 8y ago
How does this work on a single-CPU system? Wouldn’t the various idle checks and governor calls keep the CPU always busy? Or is there some way to turn off something so these instructions don’t mark the CPU as “active”?
- fermienrico 8y agoFreeRTOS or most RTOS use idle time to go into low power or sleep mode. It makes sense in an embedded system which is often powered on batteries.
- bigcheesegs 8y agoThe idle checks all happen in the kernel scheduling code which runs on every CPU/core/hyperthread between doing real work. There isn't a separate core which hands out work or controls them. The kernel knows which CPUs are active because it's the one running things, not because it asks the CPU if it ran any code. On a single CPU system it works because when the current process stops running (calls sleep, does IO, etc...) the kernel looks to see if there's anything else to do, if not, it knows the system is now idle.