Skip to contentSkip to conversation

TSC marked unstable on suspend and resume

PATCH David Fries 5 participants 11 messages Feb 21, 2009 – May 9, 2009 Timekeeping, clocksource core, NTP, alarmtimer

lore
Share & tools
lore
#0 lore raw

I'm getting TSC marked as unsable on hibernate to disk with 2.6.29-rc3. The last kernel I ran 2.6.24.4 ran 300+ days without a problem and does not loose TSC on hibernate.

I'm hibernating with echo disk > /sys/power/state. These look like the relavant messages,

CPU 0 irqstacks, hard=c0379000 soft=c0378000
PID hash table entries: 1024 (order: 10, 4096 bytes)
Fast TSC calibration using PIT
Detected 300.705 MHz processor.
Calibrating delay loop (skipped), value calculated using timer frequency.. 601.41 BogoMIPS (lpj=300705) hibernate to disk,
Restarting tasks ... done.
Clocksource tsc unstable (delta = 499883531 ns)

another reboot,
Restarting tasks ... done.
Clocksource tsc unstable (delta = 499883531 ns)

another reboot,
Freezing user space processes ... (elapsed 0.07 seconds) done. Freezing remaining freezable tasks ... (elapsed 0.00 seconds) done.
PM: Shrinking memory... ^H-<4>Clocksource tsc unstable (delta = 78961880 ns) ^H\^H|^H/^Hdone (34745 pages freed)

I didn't spot the problem until I raw the HP48 calculator emulator x48 and it was running like a dog, but the same binary ran fine on my other systems. It was looping on gettimeofday intending to delay 2us, but was getting 1ms when TSC wasn't available.

Quoted 3 lines · Ingo Molnar

What does this tool output:

http://people.redhat.com/mingo/time-warp-test/time-warp-test.c

time-warp-test is getting the number of CPUs wrong here, trivial patch included.

./time-warp-test
2 CPUs, running 2 parallel test-tasks.

grep processor /proc/cpuinfo
processor : 0
model name : AMD-K6(tm) 3D processor

time-warp-test.c renamed from time-warp-test.c.orig +1 -1
@@ -295,7 +295,7 @@ int main(int argc, char **argv)
 	unsigned long *shared;
 	unsigned long cpus, tasks;
 
-	cpus = system("exit `grep processor /proc/cpuinfo  | wc -l`");
+	cpus = system("exit `grep ^processor /proc/cpuinfo  | wc -l`");
 	cpus = WEXITSTATUS(cpus);
 
 	if (argc > 2) {

With any optimizations, -O or -O1 or -O2 I don't get any status output, with -O0 I get,

./time-warp-test
1 CPUs, running 1 parallel test-tasks.
checking for time-warps via:
- read time stamp counter (RDTSC) instruction (cycle resolution)

| TSC: 0.82us, fail:0 /

Signature · 2 lines
David Fries <[email protected]>
http://fries.net/~david/ (PGP encryption key available)
#1 lore raw
Quoted 3 lines · David Fries

I'm getting TSC marked as unsable on hibernate to disk with 2.6.29-rc3. The last kernel I ran 2.6.24.4 ran 300+ days without a problem and does not loose TSC on hibernate.

Ingo, Andrew, can you please tell us who's the right person to look into this problem?

Quoted 69 lines

I'm hibernating with echo disk > /sys/power/state. These look like the relavant messages,

CPU 0 irqstacks, hard=c0379000 soft=c0378000
PID hash table entries: 1024 (order: 10, 4096 bytes)
Fast TSC calibration using PIT
Detected 300.705 MHz processor.
Calibrating delay loop (skipped), value calculated using timer frequency.. 601.41 BogoMIPS (lpj=300705) hibernate to disk,
Restarting tasks ... done.
Clocksource tsc unstable (delta = 499883531 ns)

another reboot,
Restarting tasks ... done.
Clocksource tsc unstable (delta = 499883531 ns)

another reboot,
Freezing user space processes ... (elapsed 0.07 seconds) done. Freezing remaining freezable tasks ... (elapsed 0.00 seconds) done.
PM: Shrinking memory... ^H-<4>Clocksource tsc unstable (delta = 78961880 ns) ^H\^H|^H/^Hdone (34745 pages freed)

I didn't spot the problem until I raw the HP48 calculator emulator x48 and it was running like a dog, but the same binary ran fine on my other systems. It was looping on gettimeofday intending to delay 2us, but was getting 1ms when TSC wasn't available.

Quoted 3 lines · Ingo Molnar

What does this tool output:

http://people.redhat.com/mingo/time-warp-test/time-warp-test.c

time-warp-test is getting the number of CPUs wrong here, trivial patch included.

./time-warp-test
2 CPUs, running 2 parallel test-tasks.

grep processor /proc/cpuinfo
processor : 0
model name : AMD-K6(tm) 3D processor

time-warp-test.c renamed from time-warp-test.c.orig +1 -1
@@ -295,7 +295,7 @@ int main(int argc, char **argv)
 	unsigned long *shared;
 	unsigned long cpus, tasks;
 
-	cpus = system("exit `grep processor /proc/cpuinfo  | wc -l`");
+	cpus = system("exit `grep ^processor /proc/cpuinfo  | wc -l`");
 	cpus = WEXITSTATUS(cpus);
 
 	if (argc > 2) {

With any optimizations, -O or -O1 or -O2 I don't get any status output, with -O0 I get,

./time-warp-test
1 CPUs, running 1 parallel test-tasks.
checking for time-warps via:
- read time stamp counter (RDTSC) instruction (cycle resolution)

| TSC: 0.82us, fail:0 /

#2 lore raw
Quoted 7 lines · Rafael J. Wysocki
Quoted 3 lines · David Fries

I'm getting TSC marked as unsable on hibernate to disk with 2.6.29-rc3. The last kernel I ran 2.6.24.4 ran 300+ days without a problem and does not loose TSC on hibernate.

Ingo, Andrew, can you please tell us who's the right person to look into this problem?

I'll be looking into it, I haven't yet started debugging it. If anyone has a theory of operation or what I should be lookking for, I'm all ears. This is an old AMD K6-2 300MHz system. I don't know if it matters or not, but I have NO_HZ enabled, but the timer is still going off at 1000 Hz.

I have to decide if it is worth it to split my swap partition in two so I can hibernate both my working kernel, and the test kernel. It would be nice to test a kernel and pick up where I left off. I expect rootfstype=ext2 on the test kernel and it really will keep my filesystem read only.

Quoted 74 lines
Quoted 63 lines

I'm hibernating with echo disk > /sys/power/state. These look like the relavant messages,

CPU 0 irqstacks, hard=c0379000 soft=c0378000
PID hash table entries: 1024 (order: 10, 4096 bytes)
Fast TSC calibration using PIT
Detected 300.705 MHz processor.
Calibrating delay loop (skipped), value calculated using timer frequency.. 601.41 BogoMIPS (lpj=300705) hibernate to disk,
Restarting tasks ... done.
Clocksource tsc unstable (delta = 499883531 ns)

another reboot,
Restarting tasks ... done.
Clocksource tsc unstable (delta = 499883531 ns)

another reboot,
Freezing user space processes ... (elapsed 0.07 seconds) done. Freezing remaining freezable tasks ... (elapsed 0.00 seconds) done.
PM: Shrinking memory... ^H-<4>Clocksource tsc unstable (delta = 78961880 ns) ^H\^H|^H/^Hdone (34745 pages freed)

I didn't spot the problem until I raw the HP48 calculator emulator x48 and it was running like a dog, but the same binary ran fine on my other systems. It was looping on gettimeofday intending to delay 2us, but was getting 1ms when TSC wasn't available.

Quoted 3 lines · Ingo Molnar

What does this tool output:

http://people.redhat.com/mingo/time-warp-test/time-warp-test.c

time-warp-test is getting the number of CPUs wrong here, trivial patch included.

./time-warp-test
2 CPUs, running 2 parallel test-tasks.

grep processor /proc/cpuinfo
processor : 0
model name : AMD-K6(tm) 3D processor

time-warp-test.c renamed from time-warp-test.c.orig +1 -1
@@ -295,7 +295,7 @@ int main(int argc, char **argv)
 	unsigned long *shared;
 	unsigned long cpus, tasks;
 
-	cpus = system("exit `grep processor /proc/cpuinfo  | wc -l`");
+	cpus = system("exit `grep ^processor /proc/cpuinfo  | wc -l`");
 	cpus = WEXITSTATUS(cpus);
 
 	if (argc > 2) {

With any optimizations, -O or -O1 or -O2 I don't get any status output, with -O0 I get,

Quoted 6 lines

./time-warp-test
1 CPUs, running 1 parallel test-tasks.
checking for time-warps via:
- read time stamp counter (RDTSC) instruction (cycle resolution)

| TSC: 0.82us, fail:0 /

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

Signature · 2 lines
David Fries <[email protected]>
http://fries.net/~david/ (PGP encryption key available)
#3 lore raw
Quoted 15 lines · David Fries
Quoted 7 lines · Rafael J. Wysocki
Quoted 3 lines · David Fries

I'm getting TSC marked as unsable on hibernate to disk with 2.6.29-rc3. The last kernel I ran 2.6.24.4 ran 300+ days without a problem and does not loose TSC on hibernate.

Ingo, Andrew, can you please tell us who's the right person to look into this problem?

I'll be looking into it, I haven't yet started debugging it. If anyone has a theory of operation or what I should be lookking for, I'm all ears. This is an old AMD K6-2 300MHz system. I don't know if it matters or not, but I have NO_HZ enabled, but the timer is still going off at 1000 Hz.

Quoted 5 lines

I have to decide if it is worth it to split my swap partition in two so I can hibernate both my working kernel, and the test kernel. It would be nice to test a kernel and pick up where I left off. I expect rootfstype=ext2 on the test kernel and it really will keep my filesystem read only.

Be very careful there... if you accidentally mount rw or have shared writable partition between production and test environment, you'll have problems...

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#4 lore raw
In reply to David Fries
Quoted 7 lines · David Fries

I'm getting TSC marked as unsable on hibernate to disk with 2.6.29-rc3.  The last kernel I ran 2.6.24.4 ran 300+ days without a problem and does not loose TSC on hibernate.

I'm hibernating with echo disk > /sys/power/state. These look like the relavant messages,

Quoted 8 lines

CPU 0 irqstacks, hard=c0379000 soft=c0378000
PID hash table entries: 1024 (order: 10, 4096 bytes)
Fast TSC calibration using PIT
Detected 300.705 MHz processor.
Calibrating delay loop (skipped), value calculated using timer frequency.. 601.41 BogoMIPS (lpj=300705) hibernate to disk,
Restarting tasks ... done.
Clocksource tsc unstable (delta = 499883531 ns)

Hmm. Seems like the clocksource watchdog is having some problem handling state around hibernate.

Out of curiousity: Does suspend-to-ram also trigger this?

Can you send me a full dmesg log?

thanks
-john

#5 lore raw
Quoted 17 lines · john stultz
Quoted 7 lines · David Fries

I'm getting TSC marked as unsable on hibernate to disk with 2.6.29-rc3. ?The last kernel I ran 2.6.24.4 ran 300+ days without a problem and does not loose TSC on hibernate.

I'm hibernating with echo disk > /sys/power/state. These look like the relavant messages,

Quoted 8 lines

CPU 0 irqstacks, hard=c0379000 soft=c0378000
PID hash table entries: 1024 (order: 10, 4096 bytes)
Fast TSC calibration using PIT
Detected 300.705 MHz processor.
Calibrating delay loop (skipped), value calculated using timer frequency.. 601.41 BogoMIPS (lpj=300705) hibernate to disk,
Restarting tasks ... done.
Clocksource tsc unstable (delta = 499883531 ns)

Quoted 4 lines

Hmm. Seems like the clocksource watchdog is having some problem handling state around hibernate.

Out of curiousity: Does suspend-to-ram also trigger this?

Suspend to ram isn't supported by the system, disk is the only available /sys/power/state.

Quoted 1 line

Can you send me a full dmesg log?

Attached, it was the only log I saw that had bootup through the tsc marked unstable. Looking at the log I assume I booted to a shell, hibernated, resumed, then ran init, in that case the system is as fresh and idle as it gets. This system's been up for two months and I don't reboot much so I don't remember for sure.

Quoted 2 lines

thanks
-john

Signature · 2 lines
David Fries <[email protected]>
http://fries.net/~david/ (PGP encryption key available)
#6 lore raw
Quoted 18 lines · David Fries
Quoted 17 lines · john stultz
Quoted 15 lines · David Fries

I'm getting TSC marked as unsable on hibernate to disk with 2.6.29-rc3. ?The last kernel I ran 2.6.24.4 ran 300+ days without a problem and does not loose TSC on hibernate.

I'm hibernating with echo disk > /sys/power/state. These look like the relavant messages,

CPU 0 irqstacks, hard=c0379000 soft=c0378000
PID hash table entries: 1024 (order: 10, 4096 bytes)
Fast TSC calibration using PIT
Detected 300.705 MHz processor.
Calibrating delay loop (skipped), value calculated using timer frequency.. 601.41 BogoMIPS (lpj=300705) hibernate to disk,
Restarting tasks ... done.
Clocksource tsc unstable (delta = 499883531 ns)

Quoted 2 lines
Quoted 2 lines

Hmm. Seems like the clocksource watchdog is having some problem handling state around hibernate.

Yea. This seems to be the case here. There's watchdog code and variables to handle resume properly, but there isn't a corresponding suspend hook, so the resume path doesn't actually change anything.

Here's a patch you can try, I only had time to compile test it today, so its untested. Hopefully I didn't miss anything obvious.

Thomas, I suspect you intended to have something like the following?

include/linux/clocksource.h +1 -0
index 5a40d14..450431f 100644
@@ -360,6 +360,7 @@ extern void clocksource_touch_watchdog(void);
 extern struct clocksource* clocksource_get_next(void);
 extern void clocksource_change_rating(struct clocksource *cs, int rating);
 extern void clocksource_resume(void);
+extern void clocksource_suspend(void);
 
 #ifdef CONFIG_GENERIC_TIME_VSYSCALL
 extern void update_vsyscall(struct timespec *ts, struct clocksource *c);
kernel/time/clocksource.c +19 -0
index ecfd7b5..3dbe55f 100644
@@ -236,6 +236,11 @@ static void clocksource_resume_watchdog(void)
 	set_bit(0, &watchdog_resumed);
 }
 
+static void clocksource_suspend_watchdog(void)
+{
+	set_bit(1, &watchdog_resumed);
+}
+
 static void clocksource_check_watchdog(struct clocksource *cs)
 {
 	struct clocksource *cse;
@@ -278,6 +283,7 @@ static void clocksource_check_watchdog(struct clocksource *cs)
 	}
 	spin_unlock_irqrestore(&watchdog_lock, flags);
 }
+
 #else
 static void clocksource_check_watchdog(struct clocksource *cs)
 {
@@ -286,6 +292,7 @@ static void clocksource_check_watchdog(struct clocksource *cs)
 }
 
 static inline void clocksource_resume_watchdog(void) { }
+static inline void clocksource_suspend_watchdog(void) { }
 #endif
 
 /**
@@ -321,6 +328,18 @@ void clocksource_touch_watchdog(void)
 }
 
 /**
+ * clocksource_suspend - suspend the clocksource(s)
+ */
+void clocksource_suspend(void)
+{
+	unsigned long flags;
+
+	spin_lock_irqsave(&clocksource_lock, flags);
+	clocksource_suspend_watchdog();
+	spin_unlock_irqrestore(&clocksource_lock, flags);
+}
+
+/**
  * clocksource_get_next - Returns the selected clocksource
  *
  */
kernel/time/timekeeping.c +1 -0
index 687dff4..e39e3d3 100644
@@ -368,6 +368,7 @@ static int timekeeping_suspend(struct sys_device *dev, pm_message_t state)
 
 	clockevents_notify(CLOCK_EVT_NOTIFY_SUSPEND, NULL);
 
+	clocksource_suspend();
 	return 0;
 }
 
#7 lore raw
Quoted 26 lines · john stultz
Quoted 18 lines · David Fries
Quoted 17 lines · john stultz
Quoted 15 lines · David Fries

I'm getting TSC marked as unsable on hibernate to disk with 2.6.29-rc3. ?The last kernel I ran 2.6.24.4 ran 300+ days without a problem and does not loose TSC on hibernate.

I'm hibernating with echo disk > /sys/power/state. These look like the relavant messages,

CPU 0 irqstacks, hard=c0379000 soft=c0378000
PID hash table entries: 1024 (order: 10, 4096 bytes)
Fast TSC calibration using PIT
Detected 300.705 MHz processor.
Calibrating delay loop (skipped), value calculated using timer frequency.. 601.41 BogoMIPS (lpj=300705) hibernate to disk,
Restarting tasks ... done.
Clocksource tsc unstable (delta = 499883531 ns)

Quoted 2 lines
Quoted 2 lines

Hmm. Seems like the clocksource watchdog is having some problem handling state around hibernate.

Yea. This seems to be the case here. There's watchdog code and variables to handle resume properly, but there isn't a corresponding suspend hook, so the resume path doesn't actually change anything.

Quoted 6 lines

Here's a patch you can try, I only had time to compile test it today, so its untested. Hopefully I didn't miss anything obvious.

Thomas, I suspect you intended to have something like the following?

I added my own patch to verify your changes were being called, no dice. I do wonder, is it too late when the clocksource_suspend is called after Suspending consoles? Any theories why this is the only system I have that is showing the problem? It is an older system.

In the attached dmesg dump I suspended without a swap file, so it never hibernated or rebooted.

kernel/time/clocksource.c +1 -0
index 7575f23..387fed4 100644
@@ -261,6 +261,7 @@ void clocksource_suspend(void)
 	spin_lock_irqsave(&clocksource_lock, flags);
 	clocksource_suspend_watchdog();
 	spin_unlock_irqrestore(&clocksource_lock, flags);
+	printk("Calling %s\n", __func__);
 }
 
 /**
Signature · 2 lines
David Fries <[email protected]>
http://fries.net/~david/ (PGP encryption key available)
#8 lore raw
In reply to john stultz
Quoted 22 lines · On Thursday 30 April 2009 05:37:33 john stultz wrote:
Quoted 18 lines · David Fries
Quoted 17 lines · john stultz
Quoted 15 lines · David Fries

I'm getting TSC marked as unsable on hibernate to disk with 2.6.29-rc3. ?The last kernel I ran 2.6.24.4 ran 300+ days without a problem and does not loose TSC on hibernate.

I'm hibernating with echo disk > /sys/power/state. These look like the relavant messages,

CPU 0 irqstacks, hard=c0379000 soft=c0378000
PID hash table entries: 1024 (order: 10, 4096 bytes) Fast TSC calibration using PIT
Detected 300.705 MHz processor.
Calibrating delay loop (skipped), value calculated using timer frequency.. 601.41 BogoMIPS (lpj=300705) hibernate to disk, Restarting tasks ... done.
Clocksource tsc unstable (delta = 499883531 ns)

Quoted 2 lines
Quoted 2 lines

Hmm. Seems like the clocksource watchdog is having some problem handling state around hibernate.

Quoted 6 lines

Yea. This seems to be the case here. There's watchdog code and variables to handle resume properly, but there isn't a corresponding suspend hook, so the resume path doesn't actually change anything.

Here's a patch you can try, I only had time to compile test it today, so its untested. Hopefully I didn't miss anything obvious.

I have the same problem and the patch does not solve it for me too.

I noticed that after resume, ping is unable to measue short time correctly:
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.000 ms

"echo tsc >/sys/devices/system/clocksource/clocksource0/current_clocksource" fixes the problem until next hibernation:
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.223 ms

Quoted 81 lines

Thomas, I suspect you intended to have something like the following?

include/linux/clocksource.h +1 -0
index 5a40d14..450431f 100644
@@ -360,6 +360,7 @@ extern void clocksource_touch_watchdog(void);
 extern struct clocksource* clocksource_get_next(void);
 extern void clocksource_change_rating(struct clocksource *cs, int rating);
 extern void clocksource_resume(void);
+extern void clocksource_suspend(void);
 
 #ifdef CONFIG_GENERIC_TIME_VSYSCALL
 extern void update_vsyscall(struct timespec *ts, struct clocksource *c);
kernel/time/clocksource.c +19 -0
index ecfd7b5..3dbe55f 100644
@@ -236,6 +236,11 @@ static void clocksource_resume_watchdog(void)
 	set_bit(0, &watchdog_resumed);
 }
 
+static void clocksource_suspend_watchdog(void)
+{
+	set_bit(1, &watchdog_resumed);
+}
+
 static void clocksource_check_watchdog(struct clocksource *cs)
 {
 	struct clocksource *cse;
@@ -278,6 +283,7 @@ static void clocksource_check_watchdog(struct
 clocksource *cs) }
 	spin_unlock_irqrestore(&watchdog_lock, flags);
 }
+
 #else
 static void clocksource_check_watchdog(struct clocksource *cs)
 {
@@ -286,6 +292,7 @@ static void clocksource_check_watchdog(struct
 clocksource *cs) }
 
 static inline void clocksource_resume_watchdog(void) { }
+static inline void clocksource_suspend_watchdog(void) { }
 #endif
 
 /**
@@ -321,6 +328,18 @@ void clocksource_touch_watchdog(void)
 }
 
 /**
+ * clocksource_suspend - suspend the clocksource(s)
+ */
+void clocksource_suspend(void)
+{
+	unsigned long flags;
+
+	spin_lock_irqsave(&clocksource_lock, flags);
+	clocksource_suspend_watchdog();
+	spin_unlock_irqrestore(&clocksource_lock, flags);
+}
+
+/**
  * clocksource_get_next - Returns the selected clocksource
  *
  */
kernel/time/timekeeping.c +1 -0
index 687dff4..e39e3d3 100644
@@ -368,6 +368,7 @@ static int timekeeping_suspend(struct sys_device *dev,
 pm_message_t state)
 
 	clockevents_notify(CLOCK_EVT_NOTIFY_SUSPEND, NULL);
 
+	clocksource_suspend();
 	return 0;
 }
Signature · 1 line
Ondrej Zary
#9 lore raw
Quoted 26 lines · Ondrej Zary
Quoted 25 lines · On Thursday 30 April 2009 05:37:33 john stultz wrote:
Quoted 23 lines · David Fries
Quoted 22 lines · john stultz
Quoted 16 lines · David Fries

I'm getting TSC marked as unsable on hibernate to disk with 2.6.29-rc3. ?The last kernel I ran 2.6.24.4 ran 300+ days without a problem and does not loose TSC on hibernate.

I'm hibernating with echo disk > /sys/power/state. These look like the relavant messages,

CPU 0 irqstacks, hard=c0379000 soft=c0378000
PID hash table entries: 1024 (order: 10, 4096 bytes) Fast TSC calibration using PIT
Detected 300.705 MHz processor.
Calibrating delay loop (skipped), value calculated using timer frequency.. 601.41 BogoMIPS (lpj=300705) hibernate to disk, Restarting tasks ... done.
Clocksource tsc unstable (delta = 499883531 ns)

Quoted 2 lines

model name : AMD-K6(tm) 3D processor
Host bridge: VIA Technologies, Inc. VT82C598 [Apollo MVP3] (rev 04)

Hmm. Seems like the clocksource watchdog is having some problem handling state around hibernate.

Quoted 8 lines
Quoted 6 lines

Yea. This seems to be the case here. There's watchdog code and variables to handle resume properly, but there isn't a corresponding suspend hook, so the resume path doesn't actually change anything.

Here's a patch you can try, I only had time to compile test it today, so its untested. Hopefully I didn't miss anything obvious.

I have the same problem and the patch does not solve it for me too.

What CPU and motherboard chipset?

Quoted 6 lines

I noticed that after resume, ping is unable to measue short time correctly:
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.000 ms

"echo tsc >/sys/devices/system/clocksource/clocksource0/current_clocksource" fixes the problem until next hibernation:
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.223 ms

I didn't know about that, thanks for posting the tip.

Signature · 2 lines
David Fries <[email protected]>
http://fries.net/~david/ (PGP encryption key available)
#10 lore raw
Quoted 32 lines · On Saturday 09 May 2009 02:34:15 David Fries wrote:
Quoted 31 lines · Ondrej Zary
Quoted 30 lines · On Thursday 30 April 2009 05:37:33 john stultz wrote:
Quoted 18 lines · David Fries
Quoted 17 lines · john stultz
Quoted 16 lines · David Fries

I'm getting TSC marked as unsable on hibernate to disk with 2.6.29-rc3. ?The last kernel I ran 2.6.24.4 ran 300+ days without a problem and does not loose TSC on hibernate.

I'm hibernating with echo disk > /sys/power/state. These look like the relavant messages,

CPU 0 irqstacks, hard=c0379000 soft=c0378000
PID hash table entries: 1024 (order: 10, 4096 bytes) Fast TSC calibration using PIT
Detected 300.705 MHz processor.
Calibrating delay loop (skipped), value calculated using timer frequency.. 601.41 BogoMIPS (lpj=300705) hibernate to disk, Restarting tasks ... done.
Clocksource tsc unstable (delta = 499883531 ns)

Quoted 6 lines
Quoted 6 lines
Quoted 3 lines

model name : AMD-K6(tm) 3D processor
Host bridge: VIA Technologies, Inc. VT82C598 [Apollo MVP3] (rev
04)

Hmm. Seems like the clocksource watchdog is having some problem handling state around hibernate.

Yea. This seems to be the case here. There's watchdog code and variables to handle resume properly, but there isn't a corresponding suspend hook, so the resume path doesn't actually change anything.

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

Here's a patch you can try, I only had time to compile test it today, so its untested. Hopefully I didn't miss anything obvious.

I have the same problem and the patch does not solve it for me too.

What CPU and motherboard chipset?

Cyrix MII PR300 225MHz
PCPartner TXB820DS (i430TX)

Quoted 9 lines
Quoted 7 lines

I noticed that after resume, ping is unable to measue short time
correctly: 64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.000 ms

"echo tsc

Quoted 1 line

/sys/devices/system/clocksource/clocksource0/current_clocksource" fixes

the problem until next hibernation:
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.223 ms

I didn't know about that, thanks for posting the tip.

Signature · 1 line
Ondrej Zary