• Mathieu Desnoyers's avatar
    [PATCH] i386 and x86_64 TSC set_cyc2ns_scale imprecision · dacb16b1
    Mathieu Desnoyers authored
    I just found out that some precision is unnecessarily lost in the
    arch/i386/kernel/timers/timer_tsc.c:set_cyc2ns_scale function.  It uses a
    cpu_mhz parameter when it could use a cpu_khz.  In the specific case of an
    Intel P4 running at 3001.171 Mhz, the truncation to 3001 Mhz leads to an
    imprecision of 19 microseconds per second : this is very sad for a timer with
    nearly nanosecond accuracy.
    
    Fix the x86_64 architecture too.
    
    Cc: george anzinger <george@mvista.com>
    Cc: john stultz <johnstul@us.ibm.com>
    Cc: Andi Kleen <ak@muc.de>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    dacb16b1
time.c 32.5 KB