]> git.neil.brown.name Git - history.git/commit
[PATCH] monotonic clock source for hangcheck timer
authorAndrew Morton <akpm@digeo.com>
Thu, 3 Apr 2003 00:26:28 +0000 (16:26 -0800)
committerLinus Torvalds <torvalds@home.transmeta.com>
Thu, 3 Apr 2003 00:26:28 +0000 (16:26 -0800)
commit92525be57da2c2e481f9849430f6271a02eeb52a
treecd23d7e831ba4c1b120433e09fc56ae2fb047e77
parent68fa81207f9388bd2f073d23350c179ca58259b6
[PATCH] monotonic clock source for hangcheck timer

From: john stultz <johnstul@us.ibm.com>

This patch, written with the advice of Joel Becker, addresses a problem with
the hangcheck-timer.

The basic problem is that the hangcheck-timer code (Required for Oracle)
needs a accurate hard clock which can be used to detect OS stalls (due to
udelay() or pci bus hangs) that would cause system time to skew (its sort of
a sanity check that insures the system's notion of time is accurate).
However, currently they are using get_cycles() to fetch the cpu's TSC
register, thus this does not work on systems w/o a synced TSC.

As suggested by Andi Kleen (see thread here:
http://www.uwsg.iu.edu/hypermail/linux/kernel/0302.0/1234.html ) I've worked
with Joel and others to implement the monotonic_clock() interface.  Some of
the major considerations made when writing this patch were

o Needs to be able to return accurate time in the absence of multiple timer
  interrupts

o Needs to be abstracted out from the hardware

o Avoids impacting gettimeofday() performance

This interface returns a unsigned long long representing the number of
nanoseconds that has passed since time_init().
arch/i386/kernel/time.c
arch/i386/kernel/timers/timer_cyclone.c
arch/i386/kernel/timers/timer_none.c
arch/i386/kernel/timers/timer_pit.c
arch/i386/kernel/timers/timer_tsc.c
drivers/char/hangcheck-timer.c
include/asm-i386/timer.h