All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86: Reenable TSC sync check at boot, even with NONSTOP_TSC
@ 2009-12-17 20:27 Pallipadi, Venkatesh
  2009-12-17 21:00 ` Suresh Siddha
  2009-12-17 23:57 ` [tip:x86/urgent] " tip-bot for Pallipadi, Venkatesh
  0 siblings, 2 replies; 4+ messages in thread
From: Pallipadi, Venkatesh @ 2009-12-17 20:27 UTC (permalink / raw)
  To: Ingo Molnar, H Peter Anvin, Thomas Gleixner; +Cc: linux-kernel, Suresh Siddha


Commit 83ce4009 did the following change
If the TSC is constant and non-stop, also set it reliable.

But, there seems to be few systems that will end up with TSC warp across
sockets, depending on how the cpus come out of reset. Skipping TSC sync
test on such systems may result in time inconsistency later.

So, reenable TSC sync test even on constant and non-stop TSC systems.
Set, sched_clock_stable to 1 by default and reset it in
mark_tsc_unstable, if TSC sync fails.

This change still gives perf benefit mentioned in 83ce4009 for systems
where TSC is reliable.

Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
---
 arch/x86/kernel/cpu/intel.c |    1 -
 arch/x86/kernel/tsc.c       |    1 +
 2 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c
index 9c31e8b..879666f 100644
--- a/arch/x86/kernel/cpu/intel.c
+++ b/arch/x86/kernel/cpu/intel.c
@@ -70,7 +70,6 @@ static void __cpuinit early_init_intel(struct cpuinfo_x86 *c)
 	if (c->x86_power & (1 << 8)) {
 		set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC);
 		set_cpu_cap(c, X86_FEATURE_NONSTOP_TSC);
-		set_cpu_cap(c, X86_FEATURE_TSC_RELIABLE);
 		sched_clock_stable = 1;
 	}
 
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index cd982f4..597683a 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -763,6 +763,7 @@ void mark_tsc_unstable(char *reason)
 {
 	if (!tsc_unstable) {
 		tsc_unstable = 1;
+		sched_clock_stable = 0;
 		printk(KERN_INFO "Marking TSC unstable due to %s\n", reason);
 		/* Change only the rating, when not registered */
 		if (clocksource_tsc.mult)
-- 
1.6.0.6


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

* Re: [PATCH] x86: Reenable TSC sync check at boot, even with NONSTOP_TSC
  2009-12-17 20:27 [PATCH] x86: Reenable TSC sync check at boot, even with NONSTOP_TSC Pallipadi, Venkatesh
@ 2009-12-17 21:00 ` Suresh Siddha
  2009-12-17 23:57 ` [tip:x86/urgent] " tip-bot for Pallipadi, Venkatesh
  1 sibling, 0 replies; 4+ messages in thread
From: Suresh Siddha @ 2009-12-17 21:00 UTC (permalink / raw)
  To: Pallipadi, Venkatesh
  Cc: Ingo Molnar, H Peter Anvin, Thomas Gleixner,
	linux-kernel@vger.kernel.org

On Thu, 2009-12-17 at 13:27 -0700, Pallipadi, Venkatesh wrote:
> Commit 83ce4009 did the following change
> If the TSC is constant and non-stop, also set it reliable.
> 
> But, there seems to be few systems that will end up with TSC warp across
> sockets, depending on how the cpus come out of reset. Skipping TSC sync
> test on such systems may result in time inconsistency later.
> 
> So, reenable TSC sync test even on constant and non-stop TSC systems.
> Set, sched_clock_stable to 1 by default and reset it in
> mark_tsc_unstable, if TSC sync fails.
> 
> This change still gives perf benefit mentioned in 83ce4009 for systems
> where TSC is reliable.
> 
> Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>

Acked-by: Suresh Siddha <suresh.b.siddha@intel.com>


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

* [tip:x86/urgent] x86: Reenable TSC sync check at boot, even with NONSTOP_TSC
  2009-12-17 20:27 [PATCH] x86: Reenable TSC sync check at boot, even with NONSTOP_TSC Pallipadi, Venkatesh
  2009-12-17 21:00 ` Suresh Siddha
@ 2009-12-17 23:57 ` tip-bot for Pallipadi, Venkatesh
  1 sibling, 0 replies; 4+ messages in thread
From: tip-bot for Pallipadi, Venkatesh @ 2009-12-17 23:57 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, venkatesh.pallipadi, suresh.b.siddha,
	tglx

Commit-ID:  6c56ccecf05fafe100ab4ea94f6fccbf5ff00db7
Gitweb:     http://git.kernel.org/tip/6c56ccecf05fafe100ab4ea94f6fccbf5ff00db7
Author:     Pallipadi, Venkatesh <venkatesh.pallipadi@intel.com>
AuthorDate: Thu, 17 Dec 2009 12:27:02 -0800
Committer:  H. Peter Anvin <hpa@zytor.com>
CommitDate: Thu, 17 Dec 2009 14:44:35 -0800

x86: Reenable TSC sync check at boot, even with NONSTOP_TSC

Commit 83ce4009 did the following change
If the TSC is constant and non-stop, also set it reliable.

But, there seems to be few systems that will end up with TSC warp across
sockets, depending on how the cpus come out of reset. Skipping TSC sync
test on such systems may result in time inconsistency later.

So, reenable TSC sync test even on constant and non-stop TSC systems.
Set, sched_clock_stable to 1 by default and reset it in
mark_tsc_unstable, if TSC sync fails.

This change still gives perf benefit mentioned in 83ce4009 for systems
where TSC is reliable.

Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Acked-by: Suresh Siddha <suresh.b.siddha@intel.com>
LKML-Reference: <20091217202702.GA18015@linux-os.sc.intel.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
---
 arch/x86/kernel/cpu/intel.c |    1 -
 arch/x86/kernel/tsc.c       |    1 +
 2 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c
index 9c31e8b..879666f 100644
--- a/arch/x86/kernel/cpu/intel.c
+++ b/arch/x86/kernel/cpu/intel.c
@@ -70,7 +70,6 @@ static void __cpuinit early_init_intel(struct cpuinfo_x86 *c)
 	if (c->x86_power & (1 << 8)) {
 		set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC);
 		set_cpu_cap(c, X86_FEATURE_NONSTOP_TSC);
-		set_cpu_cap(c, X86_FEATURE_TSC_RELIABLE);
 		sched_clock_stable = 1;
 	}
 
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index cd982f4..597683a 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -763,6 +763,7 @@ void mark_tsc_unstable(char *reason)
 {
 	if (!tsc_unstable) {
 		tsc_unstable = 1;
+		sched_clock_stable = 0;
 		printk(KERN_INFO "Marking TSC unstable due to %s\n", reason);
 		/* Change only the rating, when not registered */
 		if (clocksource_tsc.mult)

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

* RE: [PATCH] x86: Reenable TSC sync check at boot, even with NONSTOP_TSC
  2009-12-18  4:15 Fwd: [PATCH] " Jeremy Fitzhardinge
@ 2009-12-18  5:17 ` Dan Magenheimer
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Magenheimer @ 2009-12-18  5:17 UTC (permalink / raw)
  To: Jeremy Fitzhardinge, Keir Fraser; +Cc: Xen-devel

Interesting!  The code to check for this condition
is already in Xen (tsc_check_reliability() and
host_tsc_is_safe()) but it looks like some of
the conditions will need to be changed a bit.

I'll spin a patch tomorrow.

> -----Original Message-----
> From: Jeremy Fitzhardinge [mailto:jeremy@goop.org]
> Sent: Thursday, December 17, 2009 9:16 PM
> To: Keir Fraser
> Cc: Dan Magenheimer; Xen-devel
> Subject: Fwd: [PATCH] x86: Reenable TSC sync check at boot, even with
> NONSTOP_TSC
> 
> 
> FYI.
> 
>      J
>

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

end of thread, other threads:[~2009-12-18  5:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-17 20:27 [PATCH] x86: Reenable TSC sync check at boot, even with NONSTOP_TSC Pallipadi, Venkatesh
2009-12-17 21:00 ` Suresh Siddha
2009-12-17 23:57 ` [tip:x86/urgent] " tip-bot for Pallipadi, Venkatesh
  -- strict thread matches above, loose matches on Subject: below --
2009-12-18  4:15 Fwd: [PATCH] " Jeremy Fitzhardinge
2009-12-18  5:17 ` Dan Magenheimer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.