Why does waking up from suspend take a long time?
Solution 1
"Hibernate" is suspend to disk
"Suspend" is suspend to RAM
Power Management hibernates your laptop on low battery even when it was suspended to RAM to prevent data loss.
Unfortunately waking up from a hibernate state may take longer than a regular boot. If this is the case we may consider shutting down rather than hibernating. However, then running applications will not be restored.
uswsusp may speed up wake up from hibernation.
Solution 2
I have got the same problem. It consistently occurs when a lot of swap is used at the time of suspend. If I do
># swapoff -a
># swapon -a
to completely empty swap space right before suspend, then the wakeup will always be immediate. Can you confirm that?
If you put these commands in a pre-suspend script it may work as a quick and dirty workaround. Swapoff will take a long time if you got a lot of things in the swap. But you probably don't mind if your machine is going to work a little longer after you close the lid if that's the price for immediate resume. You have to make sure, though, that you really have enough free RAM before calling swapoff.
The workaround is all but elegant and just fights the symptoms. I'll let you know if I find out about the true reason of the problem.
Just out of interest: I'm using encrypted partitions for both, my file system and swap. Anybody who has this problem does too? I already suspected that the problem may have to do with this.
Solution 3
When I had this problem with 10.10 I contacted support for my laptop and they said, "This is a known issue. It should be occurring about once in every three or four suspends." At the time they thought it was fixed in 11.04 and I have not had an issue since upgrading.
With a little digging I did find a confirmed bug in 11.04 that may be related.
system becomes very slow after suspend/resume My quad core i5 iMac
becomes unusably slow after resuming from suspend. One process will take 100% of a CPU (and nothing will run on the other cores).
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/748004
Related videos on Youtube
Smotko
Updated on September 18, 2022Comments
-
Smotko over 1 year
Sometimes when I suspend my laptop it wakes up instantly, but other times it takes around 5 minutes to wake up - in any case way longer than a cold boot.
While the laptop is waking up I can hear the hard drive working and when my laptop finally does wake up the system load is at 100%. Strangely my memory is half empty (even if it was 3/4 full (not counting cache) when I suspend the laptop) but my swap isn't (I have 4GBs of RAM and this is the only time I see swap not being empty).
It seems to me that while waking up my laptop sometimes starts thrashing, but I have no idea what is causing it, how to prevent it or even how to debug it.
My laptop is a hp elitebook 8730w.
EDIT:
Here is a screenshot of the System Load Indicator when I get to my desktop. There is at least 1.8GB of RAM free but there is 1.4GB in swap, why is that so?
-
Hovercouch over 12 yearsI have had the same issue using 10.10 and it is not related to hibernate. I have not seen it since upgrading to 11.04, though.
-
-
Smotko almost 13 yearsMy problem is with using suspend (I have changed my original post to better reflect that). And it's really weird that my disk is active when my laptop is waking up from suspend.
-
Takkat almost 13 yearsIn addition to hibernate from a supended state (on low battery) there may also be problems from your system hardware that may cause a damaged suspend. Then a proper resume can not be done and the system will reboot.
-
Smotko almost 13 yearsI have the problem even when my laptop is plugged in.
-
Smotko over 12 yearsThanks for the bug link, this seems to be the same problem that I'm having.
-
Hovercouch over 12 yearsThe only time I have seen suspend-to-RAM convert to suspend-to-disk this way was when battery power was low. In any case, the loading delay that this bug creates is much longer than resuming from hibernate has ever been for me. Literally minutes of the HD LED blinking solid before any activity on the display.
-
Hovercouch over 12 yearsI should not have said anything about now having the issue... it just happened today. It might be a clue, however, that it only happened after I had left the machine unplugged and it had suspended automatically. However, on a subsequent suspend/resume, there was no delay.