lkml.org 
[lkml]   [2007]   [Feb]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH -mm] gtod persistent clock resume fix
From
Date
The reworked highres/dyntick code made a thinko in the resume code
visible, which was magically working in the old queue.

On resume we add the slept time to xtime. This delta must be adjusted in
wall_to_monotonic as well. The update of jiffies64 is bogus and a
leftover of the code which was taken from arch/i386/kernel/time.c.

On suspend the current state of xtime, wall_to_monotonic and jiffies is
frozen. After resume we need to add the slept time to xtime, but we need
to subtract it from wall_to_monotonic, so the monotonic time is resuming
from exactly the point where it was suspended. jiffies are restarting
from the same point as well.

This solves the resume waittime observed by Karsten Wiese.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

Index: linux-2.6.20-rc6-mm/kernel/timer.c
===================================================================
--- linux-2.6.20-rc6-mm.orig/kernel/timer.c
+++ linux-2.6.20-rc6-mm/kernel/timer.c
@@ -985,8 +985,9 @@ static int timekeeping_resume(struct sys

if (now && (now > timekeeping_suspend_time)) {
unsigned long sleep_length = now - timekeeping_suspend_time;
+
xtime.tv_sec += sleep_length;
- jiffies_64 += (u64)sleep_length * HZ;
+ wall_to_monotonic.tv_sec -= sleep_length;
}
/* re-base the last cycle value */
clock->cycle_last = clocksource_read(clock);
@@ -994,7 +995,7 @@ static int timekeeping_resume(struct sys
timekeeping_suspended = 0;
write_sequnlock_irqrestore(&xtime_lock, flags);

- clockevents_notify(CLOCK_EVT_NOTIFY_RESUME, NULL);
+ touch_softlockup_watchdog();
/* Resume hrtimers */
clock_was_set();


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-02-01 14:05    [W:0.156 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site