From f4304ab21513b834c8fe3403927c60c2b81a72d7 Mon Sep 17 00:00:00 2001 From: john stultz Date: Fri, 16 Feb 2007 01:27:26 -0800 Subject: [PATCH] HZ free ntp Distangle the NTP update from HZ. This is necessary for dynamic tick enabled kernels. Cc: Thomas Gleixner Cc: Ingo Molnar Cc: john stultz Cc: Roman Zippel Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- kernel/hrtimer.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'kernel/hrtimer.c') diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c index f44e499e8fc..80666f6cd4f 100644 --- a/kernel/hrtimer.c +++ b/kernel/hrtimer.c @@ -128,15 +128,20 @@ EXPORT_SYMBOL_GPL(ktime_get_ts); static void hrtimer_get_softirq_time(struct hrtimer_base *base) { ktime_t xtim, tomono; + struct timespec xts; unsigned long seq; do { seq = read_seqbegin(&xtime_lock); - xtim = timespec_to_ktime(xtime); - tomono = timespec_to_ktime(wall_to_monotonic); - +#ifdef CONFIG_NO_HZ + getnstimeofday(&xts); +#else + xts = xtime; +#endif } while (read_seqretry(&xtime_lock, seq)); + xtim = timespec_to_ktime(xts); + tomono = timespec_to_ktime(wall_to_monotonic); base[CLOCK_REALTIME].softirq_time = xtim; base[CLOCK_MONOTONIC].softirq_time = ktime_add(xtim, tomono); } -- cgit v1.2.3