Messages in this thread Patch in this message | | | From | Mark-Andre Hopf <> | Subject | `do_fast_gettimeoffset' still broken in 2.2.0-final | Date | Fri, 22 Jan 1999 11:09:25 +0100 (MET) |
| |
Hello,
some programs, eg. XAnim or snes9x, still hang for several seconds on my Dual PentiumPro-180 system for 23s because do_gettimeofday delivers wrong values. The bug becomes visible when running the program below and a `find /' at the same time. My first assumption, my large difference in the TSC registers was wrong, so I guess this bug should be visible on other Intel SMP systems too, maybe even UP systems. When this can't be fixed in time, someone should remove the `do_fast_gettimeoffset' in `linux/arch/i386/kernel/time.c' for 2.2.0, patch below.
#include <stdio.h> #include <unistd.h> #include <syscall.h> #include <sys/time.h>
struct timeval t;
main() { t.tv_sec = 0; while(1) { int oldsec = t.tv_sec; syscall(SYS_gettimeofday, &t, NULL); if (t.tv_sec<oldsec) printf("TIME ERROR: %ds\n", oldsec-t.tv_sec); } }
Bye, Mark
--- linux/arch/i386/kernel/time.c.old Fri Jan 22 10:27:19 1999 +++ linux/arch/i386/kernel/time.c Fri Jan 22 11:05:04 1999 @@ -653,7 +653,8 @@ */ dodgy_tsc(); - + +#if 0 if (boot_cpu_data.x86_capability & X86_FEATURE_TSC) { #ifndef do_gettimeoffset do_gettimeoffset = do_fast_gettimeoffset; @@ -674,6 +675,7 @@ printk("Detected %ld Hz processor.\n", cpu_hz); } } +#endif #ifdef CONFIG_VISWS printk("Starting Cobalt Timer system clock\n"); - 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/
| |