Re: Whats the purpose of get_cycles_sync()

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Joerg Roedel <joerg.roedel@...>
Cc: <tglx@...>, <mingo@...>, <hpa@...>, <linux-kernel@...>, <benjamin.serebrin@...>, <vojtech@...>
Date: Tuesday, October 30, 2007 - 4:21 pm

"Joerg Roedel" <joerg.roedel@amd.com> writes:


Vojtech had one test that tested time monotonicity over CPUs 
and it constantly failed until we added the CPUID on K8 C stepping. 
He can give details on the test.

I suspect the reason was because the CPU reordered the RDTSCs so that
a later RDTSC could return a value before an earlier one. This can
happen because gettimeofday() is so fast that a tight loop calling it can
fit more than one iteration into the CPU's reordering window.


That is why newer kernels use RDTSCP if available which doesn't need
to be intercepted and is synchronous.  And since all AMD SVM systems
have RDTSCP they are fine.

On Intel Core2 without RDTSCP the CPUID can be still intercepted right
now, but the real fix there is to readd FEATURE_SYNC_TSC for Core2 --
the RDTSC there is always monotonic per CPU and the patch that changed
that (f3d73707a1e84f0687a05144b70b660441e999c7) was bogus and must be
reverted. I didn't catch that in time unfortunately.

-Andi
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Whats the purpose of get_cycles_sync(), Joerg Roedel, (Tue Oct 30, 1:44 pm)
Re: Whats the purpose of get_cycles_sync(), Andi Kleen, (Tue Oct 30, 4:21 pm)
Re: Whats the purpose of get_cycles_sync(), Joerg Roedel, (Wed Oct 31, 6:18 am)
Re: Whats the purpose of get_cycles_sync(), Vojtech Pavlik, (Tue Oct 30, 6:02 pm)
Re: Whats the purpose of get_cycles_sync(), Joerg Roedel, (Wed Oct 31, 6:23 am)
Re: Whats the purpose of get_cycles_sync(), Andi Kleen, (Tue Oct 30, 6:42 pm)