A quick correct to what I said above:
Use swap size as "/sys/power/image_size" may not be a good decision in some 
cases. If you just want to make your suspend work, try:
"echo 0 > /sys/power/image_size"

For those who is curious about the cause and reason please read on:
reading more "kernel/Documentation/power/swsusp.txt" I got known that that 
"/sys/power/image_size" was introduced since 2.6.16 kernel as a way to improve 
responsiveness after resuming. By saving more memory, which includes more 
"volatile" data such as cache, buffer, etc., to hibernation image you can get a 
more responsive system after resuming (no need to pull data out of HD bit by 
bit, you retained your old cache), the dark side is larger image, thus may lead 
to the "not enough free space" error reported here, which means the swsusp 
can't find a "contiguous" space in swap large enough to hold the image (if you 
have more than one swap par, swsusp can use one only.... :X  )

Therefore the most conservative way is to set "/sys/power/image_size" to
zero, or some very small size. In this way, most "volatile" memory (such
as cache, buffer, etc.) would be freed during hibernation, and thus lead
to smallest image.

This further explains why the reporter's "echo 2048248 >
/sys/power/image_size" works for most people, because 2048248 is too
small (just 2M) and requires fewer swap than the default 500M setting.

I'll read the code of swsusp later if I have more time. And hope some
kernel guru could help us on this.  :)

And I think to make most average people's hibernation work out-of-the-
box, Ubuntu should set image_size to 0 by default. Those who wanna
better performance (and more tech savvy) could just change it after
installation by themselves.

-- 
Suspend to disk fails: image_size too small
https://bugs.launchpad.net/bugs/88377
You received this bug notification because you are a member of Ubuntu
Bugs, which is the bug contact for Ubuntu.

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to