You are not logged in.

#1 2016-07-15 18:29:52

simo8989
Member
Registered: 2015-12-22
Posts: 72

[SOLVED]Resume my system fails after a long hibernation

Hi as stated in the title I have the problem that my system fails to resume after a 1 hour or more hibernation period.
The system always resumes correctly if I resume after around half an hour or less.
I have tryed many times and I can consistently repeat the bug if I wait a sufficient amount of time.
I followed the arch wiki for setting up the hibernation on my system through systemd.

Here is how I hibernate:

[simone@simonepc ~]$ cat /boot/loader/entries/arch.conf
title Arch Linux
linux /vmlinuz-linux
initrd /intel-ucode.img
initrd /initramfs-linux.img
options root=PARTUUID=2a5028c4-2aef-42c7-95ea-ff6ce2195504 rw acpi_sleep=nonvs resume=UUID=8cac97f6-3f1b-4a64-8a93-b5fd4a8b17e3

Here is how I setted the hooks

[simone@simonepc ~]$ cat /etc/mkinitcpio.conf
# vim:set ft=sh
# MODULES
# The following modules are loaded before any boot hooks are
# run.  Advanced users may wish to specify all system modules
# in this array.  For instance:
#     MODULES="piix ide_disk reiserfs"
MODULES=""

# BINARIES
# This setting includes any additional binaries a given user may
# wish into the CPIO image.  This is run last, so it may be used to
# override the actual binaries included by a given hook
# BINARIES are dependency parsed, so you may safely ignore libraries
BINARIES=""

# FILES
# This setting is similar to BINARIES above, however, files are added
# as-is and are not parsed in any way.  This is useful for config files.
FILES=""

# HOOKS
# This is the most important setting in this file.  The HOOKS control the
# modules and scripts added to the image, and what happens at boot time.
# Order is important, and it is recommended that you do not change the
# order in which HOOKS are added.  Run 'mkinitcpio -H <hook name>' for
# help on a given hook.
# 'base' is _required_ unless you know precisely what you are doing.
# 'udev' is _required_ in order to automatically load modules
# 'filesystems' is _required_ unless you specify your fs modules in MODULES
# Examples:
##   This setup specifies all modules in the MODULES setting above.
##   No raid, lvm2, or encrypted root is needed.
#    HOOKS="base"
#
##   This setup will autodetect all modules for your system and should
##   work as a sane default
#    HOOKS="base udev autodetect block filesystems"
#
##   This setup will generate a 'full' image which supports most systems.
##   No autodetection is done.
#    HOOKS="base udev block filesystems"
#
##   This setup assembles a pata mdadm array with an encrypted root FS.
##   Note: See 'mkinitcpio -H mdadm' for more information on raid devices.
#    HOOKS="base udev block mdadm encrypt filesystems"
#
##   This setup loads an lvm2 volume group on a usb device.
#    HOOKS="base udev block lvm2 filesystems"
#
##   NOTE: If you have /usr on a separate partition, you MUST include the
#    usr, fsck and shutdown hooks.
HOOKS="base udev autodetect modconf block resume filesystems keyboard fsck"

# COMPRESSION
# Use this to compress the initramfs image. By default, gzip compression
# is used. Use 'cat' to create an uncompressed image.
#COMPRESSION="gzip"
#COMPRESSION="bzip2"
#COMPRESSION="lzma"
#COMPRESSION="xz"
#COMPRESSION="lzop"
#COMPRESSION="lz4"

# COMPRESSION_OPTIONS
# Additional options for the compressor
#COMPRESSION_OPTIONS=""

Last edited by simo8989 (2016-08-07 22:11:36)

Offline

#2 2016-07-16 03:22:03

Prew
Member
Registered: 2006-12-31
Posts: 14

Re: [SOLVED]Resume my system fails after a long hibernation

I have a similar problem.
Try to add "nosmp" kernel parameter when you resume system.

Offline

#3 2016-07-20 12:08:37

simo8989
Member
Registered: 2015-12-22
Posts: 72

Re: [SOLVED]Resume my system fails after a long hibernation

Prew wrote:

I have a similar problem.
Try to add "nosmp" kernel parameter when you resume system.

Thanks for your help I tryed nosmp boot parameter but unfortunately with this parm when I start the system the wifi never works, and is impossible to connect to the internet so I cant use it.

I can't find any documentation on "nosmp" what does it do?

Last edited by simo8989 (2016-07-20 12:21:54)

Offline

#4 2016-07-21 10:06:20

simo8989
Member
Registered: 2015-12-22
Posts: 72

Re: [SOLVED]Resume my system fails after a long hibernation

I am really struggling, searching and reading everywhere to solve the issue.
How you guys using Gnome Shell hibernate?

Offline

#5 2016-07-22 12:26:32

simo8989
Member
Registered: 2015-12-22
Posts: 72

Re: [SOLVED]Resume my system fails after a long hibernation

Guys I found out what it was! I tried to hibernate by the terminal with:

sudo systemctl hibernate

And hibernating in this way works! I can correcty resume my system even after 1 day long hibernation.

Now the problem is, how to obtain the same effect closing the laptop lid.
If I do that it actually hibernates but if I resume after 1 hour the system always fails to resume, so it must hibernate in a different way than "systemctl hibernate".

my logind.conf look like this:

[simone@simonepc ~]$ cat /etc/systemd/logind.conf
#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.
#
# Entries in this file show the compile time defaults.
# You can change settings by editing this file.
# Defaults can be restored by simply deleting this file.
#
# See logind.conf(5) for details.

[Login]
#NAutoVTs=6
#ReserveVT=6
#KillUserProcesses=no
#KillOnlyUsers=
#KillExcludeUsers=root
#InhibitDelayMaxSec=5
#HandlePowerKey=poweroff
#HandleSuspendKey=suspend
#HandleHibernateKey=hibernate
HandleLidSwitch=hibernate
HandleLidSwitchDocked=ignore
#PowerKeyIgnoreInhibited=no
#SuspendKeyIgnoreInhibited=no
#HibernateKeyIgnoreInhibited=no
#LidSwitchIgnoreInhibited=yes
#HoldoffTimeoutSec=30s
#IdleAction=ignore
#IdleActionSec=30min
#RuntimeDirectorySize=10%
#RemoveIPC=yes
#InhibitorsMax=8192
#SessionsMax=8192
#UserTasksMax=12288

Is it anyone that can help me to make the laptop lid closing work exatly like typing on the terminal:

sudo systemctl hibernate

Thank you in advance.
Simone

Offline

#6 2016-07-22 14:19:46

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,740

Re: [SOLVED]Resume my system fails after a long hibernation

simo8989 wrote:

I am really struggling, searching and reading everywhere to solve the issue.
How you guys using Gnome Shell hibernate?

Are you using Gnome?  (Or KDE, or xfe4?)

Sometimes these environments overstep a little bit and try to everything to everyone.  If you are using one of these, make sure that they are not getting involved and are not also trying to control the hibernation process.
That it works for half an hour and then goes "Tango Uniform" sounds almost like something is trying a hybrid sleep in which data are written to disk, but then the system goes into a suspend to RAM state for a while -- after which it does a full shutdown anticipating restoring the state from disk.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#7 2016-07-22 14:36:56

simo8989
Member
Registered: 2015-12-22
Posts: 72

Re: [SOLVED]Resume my system fails after a long hibernation

ewaller wrote:
simo8989 wrote:

I am really struggling, searching and reading everywhere to solve the issue.
How you guys using Gnome Shell hibernate?

Are you using Gnome?  (Or KDE, or xfe4?)

Sometimes these environments overstep a little bit and try to everything to everyone.  If you are using one of these, make sure that they are not getting involved and are not also trying to control the hibernation process.
That it works for half an hour and then goes "Tango Uniform" sounds almost like something is trying a hybrid sleep in which data are written to disk, but then the system goes into a suspend to RAM state for a while -- after which it does a full shutdown anticipating restoring the state from disk.

Thank you.
I am using Gnome, and yes the situation seems to be like you described it, when I close the lid it probably suspends to ram rather than hibernate and after shut down the system after an half hour.
How can I start to make the diagnosis you suggested under gnome?
I searched around and in the wiki but it seems that nothing describes this specific gnome behavior, the only thing I found out is that I don't have to install pm-utils. And I don't have it on my system.

Offline

#8 2016-07-22 15:04:54

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,740

Re: [SOLVED]Resume my system fails after a long hibernation

To be honest, I don't know.  I use i3 and Openbox; I have not used Gnome for years.  I think there is some sort of settings panel where you can control power.  Brightness settings on battery; time until display off when idle; time until sleep when idle; etc...   I think it is one of those controls.

Last edited by ewaller (2016-07-22 15:14:44)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#9 2016-07-22 15:12:26

simo8989
Member
Registered: 2015-12-22
Posts: 72

Re: [SOLVED]Resume my system fails after a long hibernation

ewaller wrote:

To be honest, I don't know.  I use i3 and Openbox; I have *not* used Gnome for years.  I think there is some sort of settings panel where you can control power.  Brightness settings on battery; time until display off when idle; time until sleep when idle; etc...   I think it is one of those controls.

Thanks, I will try starting from that and report everything when solved.

Last edited by ewaller (2016-07-22 15:14:55)

Offline

#10 2016-07-24 18:33:25

simo8989
Member
Registered: 2015-12-22
Posts: 72

Re: [SOLVED]Resume my system fails after a long hibernation

Guys, I tried to modify /etc/systemd/logind.conf now I have all commented except for two lines:

HandleLidSwitch=hibernate
HandleLidSwitchDocked=ignore

And with this configuration hibernation works exactly as hibernating the system by the Gnome shell extension button. What I mean is that I can obtain the "long term" hibernation behaviour by simply closing the lid.

After some days of continuous test I found out that hibernation now works about 9/10 times, unfortunately I keep experiencing some rare inexplicable fails to resume.

I post here some of the last results of

sudo journalctl -u systemd-hibernate

Here you can see that the last attempt of hibernation failed

Jul 22 21:59:10 simonepc systemd[1]: Starting Hibernate...
Jul 22 21:59:10 simonepc systemd-sleep[1778]: Suspending system...
Jul 23 11:06:45 simonepc systemd-sleep[1778]: System resumed.
Jul 23 11:06:45 simonepc systemd[1]: Started Hibernate.
Jul 23 11:45:51 simonepc systemd[1]: Starting Hibernate...
Jul 23 11:45:51 simonepc systemd-sleep[2542]: Suspending system...
Jul 23 22:01:30 simonepc systemd-sleep[2542]: System resumed.
Jul 23 22:01:30 simonepc systemd[1]: Started Hibernate.
-- Reboot --
Jul 23 23:07:37 simonepc systemd[1]: Starting Hibernate...
Jul 23 23:07:37 simonepc systemd-sleep[1703]: Suspending system...
Jul 24 19:16:23 simonepc systemd-sleep[1703]: System resumed.
Jul 24 19:16:23 simonepc systemd[1]: Started Hibernate.
Jul 24 19:27:51 simonepc systemd[1]: Starting Hibernate...
Jul 24 19:27:51 simonepc systemd-sleep[2525]: Suspending system...
-- Reboot --
Jul 24 19:32:09 simonepc systemd[1]: Starting Hibernate...
Jul 24 19:32:09 simonepc systemd-sleep[1669]: Suspending system...
Jul 24 19:32:59 simonepc systemd-sleep[1669]: System resumed.
Jul 24 19:32:59 simonepc systemd[1]: Started Hibernate.
Jul 24 19:33:42 simonepc systemd[1]: Starting Hibernate...
Jul 24 19:33:42 simonepc systemd-sleep[2066]: Suspending system...
Jul 24 19:35:13 simonepc systemd-sleep[2066]: System resumed.
Jul 24 19:35:13 simonepc systemd[1]: Started Hibernate.
Jul 24 19:36:33 simonepc systemd[1]: Starting Hibernate...
Jul 24 19:36:33 simonepc systemd-sleep[2437]: Suspending system...
Jul 24 19:39:23 simonepc systemd-sleep[2437]: System resumed.
Jul 24 19:39:23 simonepc systemd[1]: Started Hibernate.
Jul 24 19:48:53 simonepc systemd[1]: Starting Hibernate...
Jul 24 19:48:53 simonepc systemd-sleep[2862]: Suspending system...
Jul 24 19:55:45 simonepc systemd-sleep[2862]: System resumed.
Jul 24 19:55:45 simonepc systemd[1]: Started Hibernate.
Jul 24 20:09:23 simonepc systemd[1]: Starting Hibernate...
Jul 24 20:09:23 simonepc systemd-sleep[3464]: Suspending system...

I also have a question for who can interpret the last command, maybe is silly but I am here to learn smile as I would like to obtain pure hibernation, is it normal that systemd-sleep is used ?

Thank you.
Simone

Last edited by simo8989 (2016-07-24 18:35:33)

Offline

#11 2016-07-26 11:46:25

simo8989
Member
Registered: 2015-12-22
Posts: 72

Re: [SOLVED]Resume my system fails after a long hibernation

Hi guys! I found out how to reproduce the resume bug everytime I want.

It was a pretty simple thing: my laptop has 7.7GiB of ram, and the swap partition is 8GiB. When I hibernate with a ram consumption above the 34% of the total (7.7GiB) it always fails to resume. When I resume after a hibernation with a ram consumption around 24%-28% it always (I actually did 25 tests in this condition) succesfully resumes the system.

This is really unexpected for me, and suggest that the swap partition should be bigger than 8Gib, but why on earth this should't be enough? 34% of 7.7GiB is 2.6 GiB so much less than my swap partition, and consider that when I hibernate at 34% of ram the swap partition is always completely empty.

Moreover for what I remember a couple of months ago when I was using ubuntu 16.04 in this laptop I used to hibernate succesfully with only 5GiB of swap.

I will wait for your suggestions before making the swap bigger because at the present it seems not logic for me to try that.

Here I show you how the system estimate the size of the image to create in swap during the hibernation with the 40.7% of ram usage:

[root@simonepc simone]# cat /sys/power/image_size
3290984448

This is around 3.29 GB so pretty less than my 8GiB partition.

Thank you in advance for any help.
Simone

EDIT: I just tried creating and enabling a 20GiB swap file for hibernation, and incredibly what happens is exatly the same. Resume fails for ram usage above 34% and works flawlessly every time I hibernate with ram usage around 28% ! This is incredible.

Last edited by simo8989 (2016-07-26 14:24:39)

Offline

#12 2016-07-28 21:15:21

simo8989
Member
Registered: 2015-12-22
Posts: 72

Re: [SOLVED]Resume my system fails after a long hibernation

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.

FluxBB bbcode test

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

Last edited by simo8989 (2016-07-28 22:39:34)

Offline

#13 2016-08-07 22:11:00

simo8989
Member
Registered: 2015-12-22
Posts: 72

Re: [SOLVED]Resume my system fails after a long hibernation

Finally I have solved!
Kernel 4.7 finally solves the issue, I ran several tests during this days even with ram usage around 95% before hibernation and it worked 100% of the times.
I decided to compile the kernel 4.7 from the source after finding this: https://bugzilla.kernel.org/show_bug.cgi?id=104771

Offline

Board footer

Powered by FluxBB