[PATCH] raise tsc clocksource rating

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <linux-kernel@...>
Cc: <tglx@...>, <rusty@...>, <jeremy@...>, <--cc@...>, <mingo@...>, <avi@...>, <kvm-devel@...>, Glauber de Oliveira Costa <glauber@...>, Glauber de Oliveira Costa <gcosta@...>
Date: Monday, October 29, 2007 - 7:10 pm

From: Glauber de Oliveira Costa <glauber@t60.localdomain>

tsc is very good time source (when it does not have drifts, does not
change it's frequency, i.e. when it works), so it should have its rating
raised to a value greater than, or equal 400.

Since it's being a tendency among paravirt clocksources to use values
around 400, we should declare tsc as even better: So we use 500.

This patch also touches the comments on clocksource.h, which suggests
that 499 would be a limit on the rating values.

Signed-off-by: Glauber de Oliveira Costa <gcosta@redhat.com>
---
 arch/x86/kernel/tsc_32.c    |    2 +-
 arch/x86/kernel/tsc_64.c    |    2 +-
 include/linux/clocksource.h |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kernel/tsc_32.c b/arch/x86/kernel/tsc_32.c
index 9ebc0da..4d91e59 100644
--- a/arch/x86/kernel/tsc_32.c
+++ b/arch/x86/kernel/tsc_32.c
@@ -280,7 +280,7 @@ static cycle_t read_tsc(void)
 
 static struct clocksource clocksource_tsc = {
 	.name			= "tsc",
-	.rating			= 300,
+	.rating			= 500,
 	.read			= read_tsc,
 	.mask			= CLOCKSOURCE_MASK(64),
 	.mult			= 0, /* to be set */
diff --git a/arch/x86/kernel/tsc_64.c b/arch/x86/kernel/tsc_64.c
index 9c70af4..4fd5b1b 100644
--- a/arch/x86/kernel/tsc_64.c
+++ b/arch/x86/kernel/tsc_64.c
@@ -262,7 +262,7 @@ static cycle_t __vsyscall_fn vread_tsc(void)
 
 static struct clocksource clocksource_tsc = {
 	.name			= "tsc",
-	.rating			= 300,
+	.rating			= 500,
 	.read			= read_tsc,
 	.mask			= CLOCKSOURCE_MASK(64),
 	.shift			= 22,
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h
index 107787a..5b0aadd 100644
--- a/include/linux/clocksource.h
+++ b/include/linux/clocksource.h
@@ -39,7 +39,7 @@ struct clocksource;
  *				A correct and usable clocksource.
  *			300-399: Desired.
  *				A reasonably fast and accurate clocksource.
- *			400-499: Perfect
+ *			>= 400 : Perfect
  *				The ideal clocksource. A must-use where
  *				available.
  * @read:		returns a cycle value
-- 
1.5.0.6

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

Messages in current thread:
[PATCH] raise tsc clocksource rating, Glauber de Oliveira Costa..., (Mon Oct 29, 7:10 pm)
Re: [PATCH] raise tsc clocksource rating, H. Peter Anvin, (Mon Oct 29, 8:17 pm)
Re: [PATCH] raise tsc clocksource rating, Zachary Amsden, (Mon Oct 29, 6:42 pm)
Re: [PATCH] raise tsc clocksource rating, Ingo Molnar, (Mon Oct 29, 6:48 pm)
Re: [PATCH] raise tsc clocksource rating, Zachary Amsden, (Mon Oct 29, 6:55 pm)
Re: [PATCH] raise tsc clocksource rating, Glauber de Oliveira Costa..., (Tue Oct 30, 7:59 am)
Re: [PATCH] raise tsc clocksource rating, Ingo Molnar, (Mon Oct 29, 7:02 pm)
Re: [PATCH] raise tsc clocksource rating, Dan Hecht, (Mon Oct 29, 7:24 pm)
Re: [PATCH] raise tsc clocksource rating, Ingo Molnar, (Tue Oct 30, 3:14 am)
Re: [kvm-devel] [PATCH] raise tsc clocksource rating, Avi Kivity, (Tue Oct 30, 12:24 am)
Re: [PATCH] raise tsc clocksource rating, Zachary Amsden, (Mon Oct 29, 7:13 pm)
Re: [PATCH] raise tsc clocksource rating, Glauber de Oliveira Costa..., (Tue Oct 30, 8:02 am)
Re: [PATCH] raise tsc clocksource rating, Zachary Amsden, (Tue Oct 30, 1:58 pm)
Re: [PATCH] raise tsc clocksource rating, Ingo Molnar, (Mon Oct 29, 7:17 pm)
Re: [PATCH] raise tsc clocksource rating, Jeremy Fitzhardinge, (Mon Oct 29, 6:52 pm)
Re: [PATCH] raise tsc clocksource rating, Ingo Molnar, (Mon Oct 29, 6:55 pm)
Re: [PATCH] raise tsc clocksource rating, Jeremy Fitzhardinge, (Mon Oct 29, 7:17 pm)
Re: [PATCH] raise tsc clocksource rating, Ingo Molnar, (Mon Oct 29, 7:21 pm)
Re: [PATCH] raise tsc clocksource rating, Jeremy Fitzhardinge, (Mon Oct 29, 7:33 pm)
Re: [PATCH] raise tsc clocksource rating, Jeremy Fitzhardinge, (Mon Oct 29, 6:45 pm)
Re: [PATCH] raise tsc clocksource rating, Thomas Gleixner, (Mon Oct 29, 6:17 pm)
Re: [PATCH] raise tsc clocksource rating, Rusty Russell, (Mon Oct 29, 10:39 pm)
Re: [PATCH] raise tsc clocksource rating, Ingo Molnar, (Tue Oct 30, 3:37 am)
Re: [PATCH] raise tsc clocksource rating, Glauber de Oliveira Costa..., (Tue Oct 30, 8:13 am)
Re: [PATCH] raise tsc clocksource rating, Rusty Russell, (Tue Oct 30, 6:52 am)
Re: [PATCH] raise tsc clocksource rating, john stultz, (Mon Oct 29, 9:26 pm)
Re: [PATCH] raise tsc clocksource rating, Ingo Molnar, (Mon Oct 29, 6:36 pm)