On Wed, Jul 25, 2012 at 11:00:41AM -0700, Jim Harris wrote: > On Wed, Jul 25, 2012 at 10:32 AM, Konstantin Belousov > <kostik...@gmail.com> wrote: > > I also asked Jim to test whether the cause the TSC sync test failure > > is the lack of synchronization between gathering data and tasting it, > > but ut appeared that the reason is genuine timecounter value going > > backward. > > I wonder if instead of timecounter going backward, that TSC test > fails because CPU speculatively performs rdtsc instruction in relation > to waiter checks in smp_rendezvous_action. Or maybe we are saying > the same thing.
Ok, the definition of the 'timecounter goes back', as I understand it: you have two events A and B in two threads, provable ordered, say, A is a lock release and B is the same lock acquisition. Assume that you take rdtsc values tA and tB under the scope of the lock right before A and right after B. Then it should be impossible to have tA > tB. I do not think that we can ever observe tA > tB if both threads are executing on the same CPU.
pgpJR10ercccV.pgp
Description: PGP signature