Skip to contentSkip to conversation

Strange IO behaviour on wakeup from sleep

DISCUSSION Benjamin Herrenschmidt 4 participants 8 messages Oct 27, 2004

lore
Share & tools
lore
#0 lore raw

Hi !

Not much datas at this point yet, but paulus and I noticed that current bk (happened already last saturday or so) has a very strange problem when waking up from sleep (suspend to ram) on our laptops.

This doesn't seem to be directly related to the PM code, at least not the arch one, as far as I know. The IDE throughput goes down to less than 100k/sec on hdparm. We haven't yet figured out where the time is lost, the disk seem to properly be restored to UDMA4 as usual, that code didn't change for ages, I don't think it's a problem at that level in IDE.

I'm not sure yet how to track that down, it could be the IO scheduler getting messed up on wakeup for some reason. Any clue appreciated.

Ben.

#1 lore raw
Quoted 13 lines · Benjamin Herrenschmidt

Hi !

Not much datas at this point yet, but paulus and I noticed that current bk (happened already last saturday or so) has a very strange problem when waking up from sleep (suspend to ram) on our laptops.

This doesn't seem to be directly related to the PM code, at least not the arch one, as far as I know. The IDE throughput goes down to less than 100k/sec on hdparm. We haven't yet figured out where the time is lost, the disk seem to properly be restored to UDMA4 as usual, that code didn't change for ages, I don't think it's a problem at that level in IDE.

Quoted 2 lines

I'm not sure yet how to track that down, it could be the IO scheduler getting messed up on wakeup for some reason. Any clue appreciated.

Just saw the same thing here yesterday. It's not io scheduler related (happened with even noop, if you switch to it), but apart from that I have no clues so far either.

Signature · 1 line
Jens Axboe
#2 lore raw
In reply to Benjamin Herrenschmidt
Quoted 3 lines · Benjamin Herrenschmidt

Not much datas at this point yet, but paulus and I noticed that current bk (happened already last saturday or so) has a very strange problem when waking up from sleep (suspend to ram) on our laptops.

It's a shot in the dark, but I am concerned whether timers continue to work correctly after suspend with the following patch from Linus' bk tree. I think jiffies may not be set behind the back of the timer subsystem, but maybe it works if we can guarantee there are no timers scheduled.

It might be worth backing out and retesting.

Tim

[PATCH] swsusp: fix process start times after resume

http://linus.bkbits.net:8080/linux-2.5/cset@4174ae167_Yica8ChkiLcj_rmOcG1Q?nav=index.html|ChangeSet@-2w

# This is a BitKeeper generated diff -Nru style patch. #
# ChangeSet
# 2004/10/18 23:03:02-07:00 [email protected]
# [PATCH] swsusp: fix process start times after resume
#
# Currently, process start times change after swsusp (because they are
# derived from jiffies and current time, oops). This should fix it.
#
# Signed-off-by: Andrew Morton <[email protected]>
# Signed-off-by: Linus Torvalds <[email protected]>
#

# arch/i386/kernel/time.c
#   2004/10/18 22:26:45-07:00 [email protected] +5 -1
#   swsusp: fix process start times after resume
#
diff -Nru a/arch/i386/kernel/time.c b/arch/i386/kernel/time.c
--- a/arch/i386/kernel/time.c	2004-10-27 03:58:08 -07:00
+++ b/arch/i386/kernel/time.c	2004-10-27 03:58:08 -07:00
@@ -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;
}

#3 lore raw
Quoted 6 lines · Tim Schmielau
Quoted 3 lines · Benjamin Herrenschmidt

Not much datas at this point yet, but paulus and I noticed that current bk (happened already last saturday or so) has a very strange problem when waking up from sleep (suspend to ram) on our laptops.

Quoted 6 lines

It's a shot in the dark, but I am concerned whether timers continue to work correctly after suspend with the following patch from Linus' bk tree. I think jiffies may not be set behind the back of the timer subsystem, but maybe it works if we can guarantee there are no timers scheduled.

It might be worth backing out and retesting.

The problem has been observed on ppc, while this patch only affects i386...

Ben.

#4 lore raw
Quoted 2 lines · Benjamin Herrenschmidt

The problem has been observed on ppc, while this patch only affects i386...

Oops, sorry for the noise.

Still need to check whether this patch is a problem or not.

Tim

#5 lore raw
In reply to Benjamin Herrenschmidt

Hi.

Quoted 2 lines · Benjamin Herrenschmidt

The problem has been observed on ppc, while this patch only affects i386...

Another shot in the dark....

Nothing interesting about /proc/interrupts?

Regards,

Nigel

Signature · 7 lines
Nigel Cunningham
Pastoral Worker
Christian Reformed Church of Tuggeranong
PO Box 1004, Tuggeranong, ACT 2901

Everyone lives by faith. Some people just don't believe it.
Want proof? Try to prove that the theory of evolution is true.
#6 lore raw
Quoted 9 lines · Nigel Cunningham

Hi.

Quoted 2 lines · Benjamin Herrenschmidt

The problem has been observed on ppc, while this patch only affects i386...

Another shot in the dark....

Nothing interesting about /proc/interrupts?

Nope, looked already, interrupts seem to flow normally... the box works, there are no errors or lost interrupts, it's just that disk IOs are _extremely_ slow...

Ben.

#7 lore raw

Hi again.

Quoted 7 lines · Benjamin Herrenschmidt
Quoted 6 lines · Nigel Cunningham

Hi.

Quoted 2 lines · Benjamin Herrenschmidt

The problem has been observed on ppc, while this patch only affects i386...

Quoted 7 lines
Quoted 3 lines

Another shot in the dark....

Nothing interesting about /proc/interrupts?

Nope, looked already, interrupts seem to flow normally... the box works, there are no errors or lost interrupts, it's just that disk IOs are _extremely_ slow...

One more, if I may... no processes sucking CPU? (That would indicate a thread not properly handled by the refrigerating).

Regards,

Nigel

Signature · 7 lines
Nigel Cunningham
Pastoral Worker
Christian Reformed Church of Tuggeranong
PO Box 1004, Tuggeranong, ACT 2901

Everyone lives by faith. Some people just don't believe it.
Want proof? Try to prove that the theory of evolution is true.