How is user space notified of CPU speed changes?
Quoted 7 lines · Alan Cox
It did
- The kernel doesn't always know
- CPU speed is meaningless in hyper-threading since performance is not x2 for two cores but instead varies
- It doesn't handle split CPU speed SMP - where CPU speeds vary
- God help you if virtualised
Even without virtualization it doesn't make much sense to know the exact CPU speed for an user process: it never knows how much CPU time it will get (even with real time scheduling there could be even higher priority processes)
The solution is to call gettimeofday frequently to resychronize. It should be cheap enough that it isn't a big issue.
-Andi