This patch adds the two POSIX clocks CLOCK_REALTIME_HR and CLOCK_MONOTONIC_HR to the posix clocks & timers package. A small change is made in sched.h and the rest of the patch is against .../kernel/posix_timers.c. Concerns and on going work: The kernel interface to the signal delivery code and it's need for ®s causes the nanosleep and clock_nanosleep code to be very messy. The supplied interface works for the x86 platform and provides the hooks for other platforms to connect (see .../include/asm-i386/signal.h for details), but a much cleaner solution is desired. This patch guards against overload by limiting the repeat interval of timers to a fixed value (currently 0.5 ms). A suggested change, and one I am working on, is to not put the timer back in the timer list until the user's signal handler has completed processing the current expiry. This requires a call back from the signal completion code, again a platform dependent thing, BUT it has the advantage of automatically adjusting the interval to match the hardware, the system overhead and the current load. In all cases, the standard says we need to account for the overruns, but by not getting the timer interrupt code involved in useless spinning, we just bump the overrun, saving a LOT of overhead. This patch fixes the high resolution timer resolution at 1 micro second. Should this number be a CONFIG option? I think it would be a "good thing"® to move the NTP stuff to the jiffies clock. This would allow the wall clock/ jiffies clock difference to be a "fixed value" so that code that needed this would not have to read two clocks. Setting the wall clock would then just be an adjustment to this "fixed value". It would also eliminate the problem of asking for a wall clock offset and getting a jiffies clock offset. This issue is what causes the current 2.5.44 system to fail the simple: time sleep 60 test (any value less than 60 seconds violates the standard in that it implies a timer expired early). Patch is against 2.5.44-bk1 These patches as well as the POSIX clocks & timers patch are available on the project site: http://sourceforge.net/projects/high-res-timers/ The 3 parts to the high res timers are: core The core kernel (i.e. platform independent) changes i386 The high-res changes for the i386 (x86) platform *posixhr The changes to the POSIX clocks & timers patch to use high-res timers Please apply. -- George Anzinger george@mvista.com High-res-timers: http://sourceforge.net/projects/high-res-timers/ Preemption patch: http://www.kernel.org/pub/linux/kernel/people/rml