Invariant TSC

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
devsau
Member
Member
Posts: 35
Joined: Thu Jun 13, 2013 12:07 pm

Invariant TSC

Post by devsau »

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 :wink: ?

thanks :D
User avatar
Combuster
Member
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

Post by Combuster »

devsau wrote:their claim is that it would 'reduce overhead' from the other option being a platform clock like an HPET.
Reading the TSC is an instruction of the processor. Reading an external clock requires a kernel call or a security hole.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Post Reply