Search This Blog

Sunday, October 7, 2012

upower & hibernation & swap

I have just found out that upower mark hibernation as not possible when there is no swap space available. Well, although most suspend to disk (hibernation) implementations use swap space to store the RAM image TuxOnIce is able to store the image in a dedicated file, which is not a swap space. This week I upgraded my notebook from 4 GB to 8 GB of RAM to compile webkit (one of my work for basysKom from now on :-)). 4 GB used to be enough for almost all my needs, only when I boot up a machine my notebook started to use part of the 2 GB of swap file I set up. Now with 8 GB I really do not need a swap file anymore (not even when compiling webkit), so I decided to remove my swap file and consequently upower disabled hibernation :-( As far as I could figure out there is no option in upower for force hibernation to be enable, so I created a patch to disable the swap check :-) If anyone has this same problem you can try my patch (or create something more sofisticated to  add an option to disable the swap check in upower).

8 comments:

Anonymous said...

Forget making an option. If anyone's going to write a more sophisticated patch, shouldn't they go straight to detecting the presence of tuxonice?

Lamarque said...

I would like upower to detect TuxOnIce. Unfortunately TuxOnIce has been a underdog of the suspend implementation even though it is more sofisticated (yet as stable or even more stable than the implementation in the kernel) for years. In the past years several of the orignal TuxOnIce features has been copied to the kernel but I think there are still usefull and nice features that kernel developers are not willing to implement (like the fbsplash ui). I am afraid there is too much disregard towards TuxOnIce for something to take the task of implementing a patch to upower :-(

Wyuka said...

Does pm-is-supported --hibernate return 0? hald seems to use this command to check if hibernation is possible, but upower does not do it (for some reason unknown to me). Please check and tell me.

Lamarque said...

@Wyuka, pm-is-supported return 0 and pm-hibernate works. It is just upower that refuses to hibernate because my notebook does not have any swap storage.

edm said...

I don't get it, TuxOnIce is able to hibernate even without a swap partition or a swap file?

As you said in the last comment, I know that pm-utils support swap on file so if upower does not work with it it's a bug.

Lamarque said...

You can configure a dedicated image to store the RAM image with TuxOnIce, that file is a zero'ed file, so it cannot be used as swap. I am using such file because hibernating with data in swap file was causing me troubles.

What do you mean by "swap on file"? pm-utils is just a front end, it just leverage the suspend/hibernate to the supported backends (TuxOnIce included). And by what I can see here it does not check for swap space before calling the backend.

edm said...

This is what I was talking about:
https://wiki.archlinux.org/index.php/Pm-utils#Using_Swap_file_instead_of_regular_swap_partition

Lamarque said...

Those instructions are probably for the suspend implementaion in the kernel. They are also valid por TuxOnIce, however TOI can also use a dedicated file that is not a swap file for hibernation. That is what my post is about.