Re: [kvm-devel] Performance overhead of get_cycles_sync

2007-12-11 Thread Joerg Roedel
On Tue, Dec 11, 2007 at 03:27:17PM +0100, Ingo Molnar wrote: > > * Dor Laor <[EMAIL PROTECTED]> wrote: > > > Here [include/asm-x86/tsc.h]: > > > > /* Like get_cycles, but make sure the CPU is synchronized. */ > > static __always_inline cycles_t get_cycles_sync(void) > > { > >unsigned long lon

Re: Performance overhead of get_cycles_sync

2007-12-11 Thread Ingo Molnar
* Ingo Molnar <[EMAIL PROTECTED]> wrote: > > Which is not on core2 which was the question about. And if it was > > turned off it wouldn't use get_cycles_sync() at all. > > it is turned off on core2 too: > > # cat /sys/devices/system/clocksource/clocksource0/current_clocksource > acpi_pm but

Re: Performance overhead of get_cycles_sync

2007-12-11 Thread Ingo Molnar
* Andi Kleen <[EMAIL PROTECTED]> wrote: > Ingo Molnar <[EMAIL PROTECTED]> writes: > > > the TSC clocksource (and hence the vsyscall code) is turned off on > > systems that fail the TOD/CLOCK portion of this test: > > Which is not on core2 which was the question about. And if it was > turned o

Re: Performance overhead of get_cycles_sync

2007-12-11 Thread Andi Kleen
Ingo Molnar <[EMAIL PROTECTED]> writes: > the TSC clocksource (and hence the vsyscall code) is turned off on > systems that fail the TOD/CLOCK portion of this test: Which is not on core2 which was the question about. And if it was turned off it wouldn't use get_cycles_sync() at all. -Andi -- To

Re: Performance overhead of get_cycles_sync

2007-12-11 Thread Ingo Molnar
* Arjan van de Ven <[EMAIL PROTECTED]> wrote: > > * Dor Laor <[EMAIL PROTECTED]> wrote: > > > > The patch below should resolve this - could you please test and Ack > > it? But this CPUID was present in v2.6.23 too, so why did it only > > show up in 2.6.24-rc for you? > > isn't this probably w

Re: Performance overhead of get_cycles_sync

2007-12-11 Thread Arjan van de Ven
On Tue, 11 Dec 2007 15:27:17 +0100 Ingo Molnar <[EMAIL PROTECTED]> wrote: > > * Dor Laor <[EMAIL PROTECTED]> wrote: > > > The patch below should resolve this - could you please test and Ack > it? But this CPUID was present in v2.6.23 too, so why did it only > show up in 2.6.24-rc for you? isn'

Re: Performance overhead of get_cycles_sync

2007-12-11 Thread Dor Laor
Ingo Molnar wrote: * Dor Laor <[EMAIL PROTECTED]> wrote: Here [include/asm-x86/tsc.h]: /* Like get_cycles, but make sure the CPU is synchronized. */ static __always_inline cycles_t get_cycles_sync(void) { unsigned long long ret; unsigned eax, edx; /* * Use RDTSCP if possible

Re: Performance overhead of get_cycles_sync

2007-12-11 Thread Andi Kleen
On Tue, Dec 11, 2007 at 04:57:16PM +0200, Dor Laor wrote: > Andi Kleen wrote: > >[headers rewritten because of gmane crosspost breakage] > > > > > >>In the latest kernel (2.6.24-rc3) I noticed a drastic performance > >>decrease for KVM networking. > >> > > > >That should not have changed for

Re: Performance overhead of get_cycles_sync

2007-12-11 Thread Dor Laor
Andi Kleen wrote: [headers rewritten because of gmane crosspost breakage] In the latest kernel (2.6.24-rc3) I noticed a drastic performance decrease for KVM networking. That should not have changed for quite some time. Also it depends on the CPU of course. I didn't find the exact

Re: Performance overhead of get_cycles_sync

2007-12-11 Thread Ingo Molnar
* Dor Laor <[EMAIL PROTECTED]> wrote: > Here [include/asm-x86/tsc.h]: > > /* Like get_cycles, but make sure the CPU is synchronized. */ > static __always_inline cycles_t get_cycles_sync(void) > { >unsigned long long ret; >unsigned eax, edx; > >/* > * Use RDTSCP if possible; it i

Re: Performance overhead of get_cycles_sync

2007-12-11 Thread Andi Kleen
[headers rewritten because of gmane crosspost breakage] > In the latest kernel (2.6.24-rc3) I noticed a drastic performance > decrease for KVM networking. That should not have changed for quite some time. Also it depends on the CPU of course. > The reason is many vmexit (exit reason is cpuid

Re: Performance overhead of get_cycles_sync

2007-12-11 Thread Dor Laor
Ingo Molnar wrote: * Dor Laor <[EMAIL PROTECTED]> wrote: > Hi Ingo, Thomas, > > In the latest kernel (2.6.24-rc3) I noticed a drastic performance > decrease for KVM networking. The reason is many vmexit (exit reason is > cpuid instruction) caused by calls to gettimeofday that uses tsc > sourcec

Re: Performance overhead of get_cycles_sync

2007-12-11 Thread Ingo Molnar
* Dor Laor <[EMAIL PROTECTED]> wrote: > Hi Ingo, Thomas, > > In the latest kernel (2.6.24-rc3) I noticed a drastic performance > decrease for KVM networking. The reason is many vmexit (exit reason is > cpuid instruction) caused by calls to gettimeofday that uses tsc > sourceclock. read_tsc cal

Performance overhead of get_cycles_sync

2007-12-11 Thread Dor Laor
Hi Ingo, Thomas, In the latest kernel (2.6.24-rc3) I noticed a drastic performance decrease for KVM networking. The reason is many vmexit (exit reason is cpuid instruction) caused by calls to gettimeofday that uses tsc sourceclock. read_tsc calls get_cycles_sync which might call cpuid in order