[Arch Linux] Resume from hibernation fails if the ram usage is above 33% before hibernating. How to fix?
I use Arch Linux and Gnome shell. I have properly configured systemd for hibernation into a swap file (kernel parametres and resume hook). When I hibernate the system with a ram usage around 28-29 % or less it always correctly resumes my system without any problem. If I repeat the test with a greater ram usage, lets say above 33% it seem to hibernate correctly (the laptop powers off) but it always (100% of the times) hangs on a black screen when its time to resume the system. The thing that I have not yet mentioned is that my swap file is 20GiB ! and my ram is only 7.7GiB in size, as you can see the 33% is 2.5GiB, so why on heart my system can't resume if it has only to put that 2.5 GiB in 20 GiB of swapfile? Thank you in advance.
About this post
- Posted
- Archived
- Score
- 30 · 100% up
- Kind
- Text
- ID
- 4up2ht
38 comments
Given that 2.5*8=20, I'd like to ask: Is is possible that you mixed bits and bytes along the way?
Interesting... what do you mean? the difference between GB and GiB ?
No, that would be the difference between a decimal gigabyte (1GB = 1000 megabytes) and a binary gigabyte (1 GiB = 1024 megabytes) (and the megabytes themselves can also be binary or decimal).
The difference between a bit and a byte is basically 1 byte = 8 bits. A bit is the minimum amount of information a processor can manipulate, and it takes the value of either 0 or 1.
Why not make the swapfile as big as your ram? This way I would assume it will cause less trouble because the ram image always perfectly fits into the swap.
Deleted before we saved it.
Hey, that's something I haven't thought of yet.
Have you checked to make sure that your RAM isn't failing?
Failing?
Like have you run memcheck86 or similar to make sure that your RAM is 100% functional. Sometimes it dies.
Well, thanks. But of course the measures that I expressed in the post are in bytes, and as you suggested in particular are in binary bytes.
Binary bytes doesn't make sense. 1 byte = 8 bits. Binary means 2 possible values, and a byte has 256 possible values
OP means GiB, not GB
Great news: https://bugzilla.kernel.org/show_bug.cgi?id=104771 This issue was fixed in the kernel v4.7.
I installed 4.7 from AUR and ran several tests and it worked!
Good news man! So happy about that! Thank you I will try 4.7 as soon as possible !
I basically have the same issue you described. Haven't checked if it's exactly over one third of the RAM when it fails, but I'll try out and report back.
The biggest problem with this is that all logs get lost and therefore I haven't been able to get more information on why it fails.
Hi everyone. I continued to run my tests now also by using uswsusp in order to "suspend to disk". I got the exactly the same behaviour as before:
Hibernation with ram < 33% ==> 100% succesfull resume Hibernation with ram > 33% ==> 100% failure to resume
After configuring and running the hibernation by the uswsusp tool "s2disk" I found out that in the configuration file is possible to set a 30 seconds pause in order to get some debug messages and when the resume fails I have made a picture to the screen in order to show you the messages.
https://s32.postimg.org/u92irglgl/image1.jpg
As you can see the first line says something about a bug:
BUG: Unable to handle kernel paging request at fffffffffff89
By the way, I am just searching around and I found out this recent post that seems related to my problem, maybe somebody more expert can help me to interpret it: https://lkml.org/lkml/2016/7/28/282
What filesystem is the swap file on?
The filesystem is the default that you make with mkswap, I followed the beginners guide in the archwiki.
Sorry, to clarify, what filesystem are you using with the rest of the system? Btrfs, for example, doesn't support swap files
What filesystem does the swapfile reside on, how big is that fs and how much of it is free?
The swap filesystem is the default one that you create with mkswap. Is slightly bigger than the ram and the swap is always completely free before hibernating. Don't worry everything is setted up properly (bootloader and kernel hooks and parametres) the problem is that this behaviour is very strange because it fails only if I try to hibernate with a big ram usage.
I've been experiencing intermittent reboots after suspending for a couple of weeks. I haven't narrowed it down to a memory issue as you have, but I'll observe and see if that's the cause on my box.
I've checked journalctl with no luck.
Deleted before we saved it.
R
Sudo pacman -S moreram
sudo pacman -Rns youpacaur -Sa youmad?
Sudo pacman -S dedotated