I decided that if cpuid indicates that TSC is 'invariant' (frequency of counter does not fluctuate between acpi power states) that I will use it as the perf counter for user-level operations.
In the Intel manual they also recommend this, but their claim is that it would 'reduce overhead' from the other option being a platform clock like an HPET.
My question is why exactly would they expect there to be more overhead? If assuming paging is enabled and the hardware registers are mapped as un-cacheable... is that the reasoning?
Anyone want to shed some light on their ideas or what you do in your own OS ?
thanks
Invariant TSC
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: Invariant TSC
Reading the TSC is an instruction of the processor. Reading an external clock requires a kernel call or a security hole.devsau wrote:their claim is that it would 'reduce overhead' from the other option being a platform clock like an HPET.