Re: gettimeofday non-monotonic on SMP 2.3.47

From: Boris Okun (bokun@home.com)
Date: Sun Feb 27 2000 - 21:20:12 EST


Hi Andrea,

Thanks for the patch! When applied to 2.3.47 it panics now in smpboot.c
in synchronize_tsc_bp because of 0 divide. My understanding is that this
happens since fast_gettimeoffset_quotient is 0 now. So I put
fast_gettimeoffset_quotient = calibrate_tsc();

before #ifdef 0 in your patch.
Now it boots OK and interactive reponse is slightly better, but still
the test program shows

$ ./timetest
Sun Feb 27 21:01:39 2000: fwd:95932/1:back max 0009987
Sun Feb 27 21:01:40 2000: fwd:124104/1:back max 0000129
Sun Feb 27 21:01:41 2000: fwd:123945/2:back max 0009984
Sun Feb 27 21:01:42 2000: fwd:123311/5:back max 0009989
Sun Feb 27 21:01:43 2000: fwd:124149/4:back max 0000160
Sun Feb 27 21:01:44 2000: fwd:123614/4:back max 0009989
Sun Feb 27 21:01:45 2000: fwd:124155/6:back max 4294932205
Sun Feb 27 21:01:46 2000: fwd:123310/4:back max 0009987
Sun Feb 27 21:01:47 2000: fwd:123109/5:back max 0009988
Sun Feb 27 21:01:48 2000: fwd:123636/5:back max 0009987

If you have any suggestions, please let me know.

Boris

Andrea Arcangeli wrote:

> --- 2.2.14/arch/i386/kernel/time.c Mon Jan 17 16:44:33 2000
> +++ /tmp/time.c Mon Feb 28 00:29:54 2000
> @@ -110,7 +110,6 @@
>
> #define TICK_SIZE tick
>
> -#ifndef CONFIG_X86_TSC
>
> /* This function must be called with interrupts disabled
> * It was inspired by Steve McCanne's microtime-i386 for BSD. -- jrs
> @@ -223,13 +222,7 @@
> return count;
> }
>
> -static unsigned long (*do_gettimeoffset)(void) = do_slow_gettimeoffset;
> -
> -#else
> -
> -#define do_gettimeoffset() do_fast_gettimeoffset()
> -
> -#endif
> +#define do_gettimeoffset() do_slow_gettimeoffset()
>
> /*
> * This version of gettimeofday has microsecond resolution
> @@ -644,6 +637,7 @@
>
> dodgy_tsc();
>
> +#if 0
> if (boot_cpu_data.x86_capability & X86_FEATURE_TSC) {
> unsigned long tsc_quotient = calibrate_tsc();
> if (tsc_quotient) {
> @@ -667,6 +661,7 @@
> }
> }
> }
> +#endif
>
> #ifdef CONFIG_VISWS
> printk("Starting Cobalt Timer system clock\n");
>
> (the above patch will probably fix your problem anyway even if your
> problem is that at least one CPU has a not correctly working TSC)
>
> Andrea

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Feb 29 2000 - 21:00:18 EST