Skip to content

[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.

30 points35 comments
Open on Reddit
About this post
Posted
Archived
Score
30 · 100% up
Kind
Text
ID
4up2ht

Author

1
posts
11
comments
0
media
View profile

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?

10 points

Interesting... what do you mean? the difference between GB and GiB ?

2 points

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.

6 points

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.

5 points
unknown author

Deleted before we saved it.

1 points

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.

2 points

Binary bytes doesn't make sense. 1 byte = 8 bits. Binary means 2 possible values, and a byte has 256 possible values

-1 points

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.

2 points

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

2 points

What filesystem is the swap file on?

1 points

The filesystem is the default that you make with mkswap, I followed the beginners guide in the archwiki.

1 points

Sorry, to clarify, what filesystem are you using with the rest of the system? Btrfs, for example, doesn't support swap files

1 points

What filesystem does the swapfile reside on, how big is that fs and how much of it is free?

1 points

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.

1 points

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.

1 points
unknown author

Deleted before we saved it.

1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.