* swsusp: fix process start times after resume
@ 2004-10-04 12:10 Pavel Machek
0 siblings, 0 replies; only message in thread
From: Pavel Machek @ 2004-10-04 12:10 UTC (permalink / raw)
To: kernel list, Andrew Morton
Hi!
Currently, process start times change after swsusp (because they are
derived from jiffies and current time, oops). This should fix
it. Please apply,
Pavel
Index: linux/arch/i386/kernel/time.c
===================================================================
--- linux.orig/arch/i386/kernel/time.c 2004-10-01 12:24:26.000000000 +0200
+++ linux/arch/i386/kernel/time.c 2004-10-01 00:53:07.000000000 +0200
@@ -319,7 +319,7 @@
return retval;
}
-static long clock_cmos_diff;
+static long clock_cmos_diff, sleep_start;
static int time_suspend(struct sys_device *dev, u32 state)
{
@@ -328,6 +328,7 @@
*/
clock_cmos_diff = -get_cmos_time();
clock_cmos_diff += get_seconds();
+ sleep_start = get_cmos_time();
return 0;
}
@@ -335,10 +336,13 @@
{
unsigned long flags;
unsigned long sec = get_cmos_time() + clock_cmos_diff;
+ unsigned long sleep_length = get_cmos_time() - sleep_start;
+
write_seqlock_irqsave(&xtime_lock, flags);
xtime.tv_sec = sec;
xtime.tv_nsec = 0;
write_sequnlock_irqrestore(&xtime_lock, flags);
+ jiffies += sleep_length * HZ;
return 0;
}
--
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-10-04 13:19 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-04 12:10 swsusp: fix process start times after resume Pavel Machek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome