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

From: Andi Kleen
Date: Tue Dec 15 2009 - 08:58:24 EST


Zachary Amsden <zamsden@xxxxxxxxxx> 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@xxxxxxxxxxxxxxx -- Speaking for myself only.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/