public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* RE: [patch] prefer TSC over PM Timer
@ 2004-11-16 18:27 Pallipadi, Venkatesh
  2004-11-17  1:50 ` dean gaudet
  0 siblings, 1 reply; 22+ messages in thread
From: Pallipadi, Venkatesh @ 2004-11-16 18:27 UTC (permalink / raw)
  To: john stultz, dean gaudet; +Cc: lkml

>-----Original Message-----
>From: linux-kernel-owner@vger.kernel.org 
>[mailto:linux-kernel-owner@vger.kernel.org] On Behalf Of john stultz
>Sent: Monday, November 15, 2004 5:38 PM
>To: dean gaudet
>Cc: lkml
>Subject: Re: [patch] prefer TSC over PM Timer
>
>On Mon, 2004-11-15 at 16:23, dean gaudet wrote:
>> i've heard other folks have independently run into this 
>problem -- in fact 
>> i see the most recent fc2 kernels already do this.  i'd like 
>this to be 
>> accepted into the main kernel though.
>> 
>> the x86 PM Timer is an order of magnitude slower than the TSC for 
>> gettimeofday calls.  i'm seeing 8%+ of the time spent doing 
>gettimeofday 
>> in someworkloads... and apparently kernel.org was seeing 80% 
>of its time 
>> go to gettimeofday during the fc3-release overload.  PM 
>timer is also less 
>> accurate than TSC.
>> 

I think trying to remove repeated inl()'s in read_pmtmr is a better 
fix for this issue. As John mentioned in other thread, we should do 
repeated reads only when something looks broken. Not always.

TSC counter stops couting when the CPU is in deep sleep state. It 
should be OK to use tsc with Centrinos which support Enhanced Speedstep
Technology. But, it will have issues with older system that supports 
Older Speedstep. So, I would say using pm_timer as default is better 
as that works correctly on most of the systems. 

Thanks,
Venki

^ permalink raw reply	[flat|nested] 22+ messages in thread
* RE: [patch] prefer TSC over PM Timer
@ 2004-11-17 15:08 Pallipadi, Venkatesh
  0 siblings, 0 replies; 22+ messages in thread
From: Pallipadi, Venkatesh @ 2004-11-17 15:08 UTC (permalink / raw)
  To: dtor_core, dean gaudet; +Cc: john stultz, lkml

>-----Original Message-----
>From: Dmitry Torokhov [mailto:dmitry.torokhov@gmail.com] 
>Sent: Wednesday, November 17, 2004 6:20 AM
>To: dean gaudet
>Cc: Pallipadi, Venkatesh; john stultz; lkml
>Subject: Re: [patch] prefer TSC over PM Timer
>
>On Tue, 16 Nov 2004 17:50:42 -0800 (PST), dean gaudet
><dean-list-linux-kernel@arctic.org> wrote:
>> on a tangent... has the local apic timer ever been 
>considered?  it's fixed
>> rate, and my measurements show it in the same performance 
>ballpark as TSC.
>> 
>
>At least Dell laptops will die horrible death if you enable lapic,
>probably others.
>

Hmm... And local APIC timer comes with its own set of problems 
http://bugme.osdl.org/show_bug.cgi?id=2560

While in C3, we don't get local APIC timer interrupts.

Thanks,
Venki

^ permalink raw reply	[flat|nested] 22+ messages in thread
* [patch] prefer TSC over PM Timer
@ 2004-11-16  0:23 dean gaudet
  2004-11-16  1:38 ` john stultz
  2004-11-17 15:25 ` Alan Cox
  0 siblings, 2 replies; 22+ messages in thread
From: dean gaudet @ 2004-11-16  0:23 UTC (permalink / raw)
  To: linux-kernel

i've heard other folks have independently run into this problem -- in fact 
i see the most recent fc2 kernels already do this.  i'd like this to be 
accepted into the main kernel though.

the x86 PM Timer is an order of magnitude slower than the TSC for 
gettimeofday calls.  i'm seeing 8%+ of the time spent doing gettimeofday 
in someworkloads... and apparently kernel.org was seeing 80% of its time 
go to gettimeofday during the fc3-release overload.  PM timer is also less 
accurate than TSC.

i can see a vague argument around cpufreq / tsc troubles, but i'm having a 
hell of a time getting a centrino box to show any TSC troubles even while 
i induce workloads that cause cpufreq to bounce the frequency around.  
maybe someone could give an example of it failing...

note:  when timer_tsc discovers inaccuracy after boot it falls back to 
timer_pit ... timer_pit is twice as expensive as timer_pm, and it'd be 
cool if timer_tsc could fall back to timer_pm... but by that point in time 
all the __init stuff is gone, so i can't see how to init timer_pm.  this 
would be a more ideal solution.

thanks
-dean

Signed-off-by: dean gaudet <dean@arctic.org>

--- linux-2.6.10-rc2/arch/i386/kernel/timers/timer.c.orig	2004-11-15 23:28:30.000000000 -0800
+++ linux-2.6.10-rc2/arch/i386/kernel/timers/timer.c	2004-11-15 23:29:07.000000000 -0800
@@ -19,10 +19,10 @@
 #ifdef CONFIG_HPET_TIMER
 	&timer_hpet_init,
 #endif
+	&timer_tsc_init,
 #ifdef CONFIG_X86_PM_TIMER
 	&timer_pmtmr_init,
 #endif
-	&timer_tsc_init,
 	&timer_pit_init,
 	NULL,
 };

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

end of thread, other threads:[~2004-11-18  2:10 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-16 18:27 [patch] prefer TSC over PM Timer Pallipadi, Venkatesh
2004-11-17  1:50 ` dean gaudet
2004-11-17 10:43   ` Mikael Pettersson
2004-11-17 14:19   ` Dmitry Torokhov
2004-11-17 15:31   ` Alan Cox
2004-11-17 17:48     ` summary (Re: [patch] prefer TSC over PM Timer) dean gaudet
2004-11-17 22:30       ` George Anzinger
2004-11-17 23:09         ` john stultz
2004-11-17 23:24           ` George Anzinger
2004-11-18  2:01   ` [patch] prefer TSC over PM Timer Krzysztof Halasa
  -- strict thread matches above, loose matches on Subject: below --
2004-11-17 15:08 Pallipadi, Venkatesh
2004-11-16  0:23 dean gaudet
2004-11-16  1:38 ` john stultz
2004-11-16  3:21   ` dean gaudet
2004-11-16  9:50     ` john stultz
2004-11-16 20:29       ` Dominik Brodowski
2004-11-16 21:06         ` john stultz
2004-11-16  8:11   ` Arjan van de Ven
2004-11-16  9:36     ` john stultz
2004-11-17 15:25     ` Alan Cox
2004-11-17 15:25 ` Alan Cox
2004-11-17 17:23   ` Chris Friesen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox