* [RFC patch] reset TSC at the begining of check_tsc_warp
@ 2009-06-01 9:01 Luming Yu
2009-06-01 23:10 ` Frans Pop
2009-06-02 7:54 ` Andi Kleen
0 siblings, 2 replies; 5+ messages in thread
From: Luming Yu @ 2009-06-01 9:01 UTC (permalink / raw)
To: LKML
[-- Attachment #1: Type: text/plain, Size: 1013 bytes --]
Hello,
Without this patch, we always get kernel warning that TSC warp between CPUs,
and TSC is marked unstable due to check_tsc_sync_source failed if the CPUs
have the problem of not-synced initial TSC.
It hurts CPUs with constant-tsc feature, but with unsynced initial TSC value...
The downside is we could break perfect synced TSC with this patch.
Please review, test and apply.
**The patch is enclosed in text attachment*
**Using web client to send the patch* *
**below is c&p just for review, please apply attached patch*/
Thanks,
Luming
Signed-off-by: Yu Luming <luming.yu@intel.com>
tsc_sync.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/x86/kernel/tsc_sync.c b/arch/x86/kernel/tsc_sync.c
index bf36328..190c1b0 100644
--- a/arch/x86/kernel/tsc_sync.c
+++ b/arch/x86/kernel/tsc_sync.c
@@ -46,6 +46,7 @@ static __cpuinit void check_tsc_warp(void)
cycles_t start, now, prev, end;
int i;
+ wrmsrl(MSR_IA32_TSC, 0);
rdtsc_barrier();
start = get_cycles();
rdtsc_barrier();
[-- Attachment #2: 2.patch --]
[-- Type: application/octet-stream, Size: 360 bytes --]
diff --git a/arch/x86/kernel/tsc_sync.c b/arch/x86/kernel/tsc_sync.c
index bf36328..190c1b0 100644
--- a/arch/x86/kernel/tsc_sync.c
+++ b/arch/x86/kernel/tsc_sync.c
@@ -46,6 +46,7 @@ static __cpuinit void check_tsc_warp(void)
cycles_t start, now, prev, end;
int i;
+ wrmsrl(MSR_IA32_TSC, 0);
rdtsc_barrier();
start = get_cycles();
rdtsc_barrier();
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [RFC patch] reset TSC at the begining of check_tsc_warp
2009-06-01 9:01 [RFC patch] reset TSC at the begining of check_tsc_warp Luming Yu
@ 2009-06-01 23:10 ` Frans Pop
2009-06-02 7:05 ` Luming Yu
2009-06-02 7:54 ` Andi Kleen
1 sibling, 1 reply; 5+ messages in thread
From: Frans Pop @ 2009-06-01 23:10 UTC (permalink / raw)
To: Luming Yu; +Cc: linux-kernel
Luming Yu wrote:
> Without this patch, we always get kernel warning that TSC warp between
> CPUs, and TSC is marked unstable due to check_tsc_sync_source failed if
> the CPUs have the problem of not-synced initial TSC.
>
> It hurts CPUs with constant-tsc feature, but with unsynced initial TSC
> value...
>
> The downside is we could break perfect synced TSC with this patch.
> Please review, test and apply.
I've tested this on my desktop (working TSC) and my laptop (non-working TSC).
On both machines the patch didn't make any difference.
Desktop: Intel mainboard, ICH7 chipset, dual core Pentium D 3.20GHz
$ dmesg | grep -i tsc
Fast TSC calibration using PIT
checking TSC synchronization [CPU#0 -> CPU#1]: passed.
Laptop: HP 2510p notebook, ICH8 chipset, Core2 Duo 1.33GHz
$ dmesg | grep -i tsc
Fast TSC calibration using PIT
checking TSC synchronization [CPU#0 -> CPU#1]: passed.
Marking TSC unstable due to TSC halts in idle
Clocksource tsc unstable (delta = -98164364 ns)
Tested on top of today's mainline git.
Cheers,
FJP
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFC patch] reset TSC at the begining of check_tsc_warp
2009-06-01 23:10 ` Frans Pop
@ 2009-06-02 7:05 ` Luming Yu
0 siblings, 0 replies; 5+ messages in thread
From: Luming Yu @ 2009-06-02 7:05 UTC (permalink / raw)
To: Frans Pop; +Cc: linux-kernel
On Tue, Jun 2, 2009 at 7:10 AM, Frans Pop <elendil@planet.nl> wrote:
> Luming Yu wrote:
>> Without this patch, we always get kernel warning that TSC warp between
>> CPUs, and TSC is marked unstable due to check_tsc_sync_source failed if
>> the CPUs have the problem of not-synced initial TSC.
>>
>> It hurts CPUs with constant-tsc feature, but with unsynced initial TSC
>> value...
>>
>> The downside is we could break perfect synced TSC with this patch.
>> Please review, test and apply.
>
> I've tested this on my desktop (working TSC) and my laptop (non-working TSC).
> On both machines the patch didn't make any difference.
Thanks for testing, but if there was no warnings like
"Measured 439164 cycles TSC warp between CPUs, turning off TSC clock."
the patch won't help....
--Luming
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFC patch] reset TSC at the begining of check_tsc_warp
2009-06-01 9:01 [RFC patch] reset TSC at the begining of check_tsc_warp Luming Yu
2009-06-01 23:10 ` Frans Pop
@ 2009-06-02 7:54 ` Andi Kleen
2009-06-02 8:28 ` Luming Yu
1 sibling, 1 reply; 5+ messages in thread
From: Andi Kleen @ 2009-06-02 7:54 UTC (permalink / raw)
To: Luming Yu; +Cc: LKML
Luming Yu <luming.yu@gmail.com> writes:
> Hello,
>
> Without this patch, we always get kernel warning that TSC warp between CPUs,
> and TSC is marked unstable due to check_tsc_sync_source failed if the CPUs
> have the problem of not-synced initial TSC.
>
> It hurts CPUs with constant-tsc feature, but with unsynced initial TSC value...
>
> The downside is we could break perfect synced TSC with this patch.
s/could/will definitely/
So you're hurting the good systems for one buggy box. I don't think
that's a good idea.
Possible alternatives:
- black list that system with DMI
- try to detect it by checking constant_tsc and still unsynchronized TSC
- just give up and say the system won't be able to use TSC unless the BIOS
fixes its act.
The third option is probably not the worst.
-Andi
--
ak@linux.intel.com -- Speaking for myself only.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFC patch] reset TSC at the begining of check_tsc_warp
2009-06-02 7:54 ` Andi Kleen
@ 2009-06-02 8:28 ` Luming Yu
0 siblings, 0 replies; 5+ messages in thread
From: Luming Yu @ 2009-06-02 8:28 UTC (permalink / raw)
To: Andi Kleen; +Cc: LKML
>
> So you're hurting the good systems for one buggy box. I don't think
> that's a good idea.
Yes, the patch should be polished to avoid already-perfect-synced-tsc
case...the whole point of this patch is trying to improve , not damage...
Although I'm not quite sure how much diff the patch could
introduce...,given execution of
the function has already synced between CPUs....But this should be
another topic..
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-06-02 8:29 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-01 9:01 [RFC patch] reset TSC at the begining of check_tsc_warp Luming Yu
2009-06-01 23:10 ` Frans Pop
2009-06-02 7:05 ` Luming Yu
2009-06-02 7:54 ` Andi Kleen
2009-06-02 8:28 ` Luming Yu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox