Re: [PATCH RFC: kvm tsc virtualization 15/20] Fix longstanding races

Andi Kleen
2009-12-15T13:58:20Z

Zachary Amsden <zamsden@redhat.com> writes:
>
> Damn, this is complicated crap. The analagous task in real life would
> be keeping a band of howler monkeys, each in their own tree, singing in
> unison while the lead vocalist jumps from tree to tree, and meanwhile,
> an unseen conductor keeps changing the tempo the piece is played at.
> Thankfully, there are no key changes, however, occasionally new trees
> sprout up at random and live ones fall over.

On CPUs where the TSC frequency is not constant typically you can't tell
exactly when the frequency changes. So you would always have a race window
where the frequency is unknown and wrong results occur. This can be worked
around, but it's quite complicated.

The safe way is to not use the TSC on such CPUs.

-Andi
--
ak@linux.intel.com -- Speaking for myself only.