linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Whats the purpose of get_cycles_sync()
@ 2007-10-30 17:44 Joerg Roedel
  2007-10-30 20:21 ` Andi Kleen
  0 siblings, 1 reply; 6+ messages in thread
From: Joerg Roedel @ 2007-10-30 17:44 UTC (permalink / raw)
  To: tglx, mingo, hpa; +Cc: linux-kernel, benjamin.serebrin

Hi,

I would like to answer what the special purpose of the get_cycles_sync()
function is in the x86 architecture. In special I ask myself why
this function has to be *sync*?

I mean, the sync should guarantee here that the CPU does not execute the
RDTSC instruction out-of-order, thats clear. But does that really
matter? If there is a cache/tlb miss before the function returns all
accuracy that should be won by the synchronous RDTSC is lost anyway.

The problem here is, that this function executes CPUID if RDTSC itself
is not a synchronizing instruction and CPUID is very often intercepted
by hypervisors (KVM intercepts it for example). This makes this function
very expensive if the kernel is executed as a guest.

But maybe I miss some important things here.

Joerg

-- 
           |           AMD Saxony Limited Liability Company & Co. KG
 Operating |         Wilschdorfer Landstr. 101, 01109 Dresden, Germany
 System    |                  Register Court Dresden: HRA 4896
 Research  |              General Partner authorized to represent:
 Center    |             AMD Saxony LLC (Wilmington, Delaware, US)
           | General Manager of AMD Saxony LLC: Dr. Hans-R. Deppe, Thomas McCoy



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-10-31 10:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-30 17:44 Whats the purpose of get_cycles_sync() Joerg Roedel
2007-10-30 20:21 ` Andi Kleen
2007-10-30 22:02   ` Vojtech Pavlik
2007-10-30 22:42     ` Andi Kleen
2007-10-31 10:23     ` Joerg Roedel
2007-10-31 10:18   ` Joerg Roedel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).