You are not logged in.

#1 2016-05-07 23:20:31

abhinavd
Member
Registered: 2014-06-09
Posts: 5

Hibernate using TuxOnIce working intermittently

In my numerous attempts to get hibernate to work well and respond fast, I have turned to using TuxOnIce with the linux-pf kernel, as detailed in the Wiki page.

I have noticed the following: When I use an amount of RAM > around 1 GB (and 0 kB of swap used), the hibernate seems to work all right- with a message like

Seeking to free __ MB of memory

(and no error until it powers off)- but the resume fails, getting stuck at the message:

Doing atomic copy/restore

I thought the issue was that of a previous image existing in my swap partition, so I decided to issue a command to erase the image by doing

echo 0 > $tuxonice_sys/image_exists

in my sleep hook for systemctl (as is described here). Here is the file:

$ sudo cat /usr/lib/systemd/system-sleep/tuxonice-userui.sh 
#!/bin/bash
# /usr/lib/systemd/system-sleep/tuxonice.sh

tuxonice_sys="/sys/power/tuxonice"
tuxoniceui_cmd="/usr/sbin/tuxoniceui"
tuxoniceui_vt=63
tuxoniceui_original_vt="/run/tuxoniceui_original_vt"

if [ "$1" = "pre" ]; then

    echo `fgconsole` > $tuxoniceui_original_vt
    chvt $tuxoniceui_vt

    if [ -d $tuxonice_sys -a -x $tuxoniceui_cmd ]; then
        if [ -c /dev/fb0 -a -d /etc/splash/tuxonice ]; then
            tuxoniceui_opt="-f"
        fi
	echo 0 > $tuxonice_sys/image_exists
        echo $tuxoniceui_cmd $tuxoniceui_opt > $tuxonice_sys/user_interface/program
    fi
fi


if [ "$1" = "post" ]; then
    chvt `< $tuxoniceui_original_vt`
    rm $tuxoniceui_original_vt
fi

It still failed to resume when using systemctl to hibernate. Note that both hibernate and resume work perfectly when there is no message like that about seeking to free some memory. I can resume from hibernate in about 10 seconds to see an equally responsive computer, unlike what I see with other methods.

Next, I tried using the hibernate-script method developed by the TuxOnIce developers. Now I see a different behaviour- Hibernate again works perfectly when the RAM used is about less than 1 GB, but when there is the message about freeing memory, this time the hibernate itself fails. It freezes when trying to hibernate and I have to manually power off the laptop.

The obvious inclination is that my swap is not sufficient, but it seems to be- I have 4GB RAM and my swap partition is 4.4 GB. In my desperation to solve this, I even created an 8 GB swap file specifically for use with TuxOnIce, but it only seems to have moved the threshold up to 1.2 GB.

For reference, I am using an HP Pavilion dv6-6115tx with the open source drivers. I can post logs when it works. But when it fails, journalctl does not show any records from the time of the crash because I manually power my system down.

I am thinking of trying out the option ImageSizeLimit, but am not sure how much of an impact it will have on my response times and whether it will fail if my RAM is full and overflowing with data. Has anyone used this option with success?

Thanks!

Other relevant files:

$ sudo cat /etc/hibernate/tuxonice.conf 
# Example tuxonice.conf file.
# 
# See hibernate.conf(5) for help on the configuration items.
#
# NOTE: TuxOnIce is an improved version of suspend-to-disk which currently
#       requires patching your kernel. For more information, see www.tuxonice.net
# 
#       If you do not wish to patch your kernel but still be able to suspend to
#       disk, see disk.conf instead.

### TuxOnIce
UseTuxOnIce yes
Reboot no
EnableEscape yes
DefaultConsoleLevel 1
Compressor lzo
#Compressor lz4hc
Encryptor none
# ImageSizeLimit 200

## useful for initrd usage:
SuspendDevice swap:/dev/sda8:0xa94000

## Powerdown method - 3 for suspend-to-RAM, 4 for ACPI S4 sleep, 5 for poweroff
 PowerdownMethod 5

## Any other /proc/software_suspend setting can be set like so:
# ProcSetting expected_compression 50

#ProcSetting no_multithreaded_io 1
ProcSetting extra_pages_allowance 20000

## Or traditionally like this:
# TuxOnIceAllSettings 0 0 2056 65535 5

## Or even from the results of hibernate --save-settings with this:
# TuxOnIceAllSettingsFile /etc/hibernate/suspend-settings.conf

## For filewriter:
# FilewriterLocation /suspend_file 1000
# VerifyFilewriterResume2 yes

## Specify a userui like this:
ProcSetting userui_program "/usr/sbin/tuxoniceui"

# Scale CPU to full speed to make sure we suspend as fast as possible.
FullSpeedCPU yes

Include common.conf
$ sudo cat /etc/hibernate/common.conf 
# Configuration options common for suspending to disk or RAM.
# Options are not case sensitive.
# 
# See hibernate.conf(5) for help on the configuration items.

##############################################################################
### Some global settings
##############################################################################

Verbosity 0
LogFile /var/log/hibernate.log
LogVerbosity 1
# LogTimestamp yes
 AlwaysForce yes
 AlwaysKill yes
# HibernateVT 15
Distribution arch
# XDisplay :0

##############################################################################
### Scriptlets
###   Scriptlets provide support for doing all sorts of things before and after
###   suspending. The defaults settings here should work for most people, but
###   you may wish to edit these to taste. Consult "hibernate -h" for help on
###   the configuration settings.
##############################################################################

### bootsplash
## If you use bootsplash, also enabling SwitchToTextMode is recommended if
## you use X, otherwise you may end up with a garbled X display.
# Bootsplash on
# BootsplashConfig /etc/bootsplash/default/config/bootsplash-1024x768.cfg

### clock
SaveClock restore-only
#DirectIsa

### devices
# IncompatibleDevices /dev/dsp /dev/video*

### diskcache
# DisableWriteCacheOn /dev/hda

### fbsplash (enable SwitchToTextMode if you use this)
 FBSplash on
 FBSplashTheme tuxonice

### filesystems
# Unmount /nfsshare /windows /mnt/sambaserver
# UnmountFSTypes smbfs nfs
# UnmountGraceTime 1
# Mount /windows

### grub
 ChangeGrubMenu yes
 GrubMenuFile /boot/grub/menu.lst
 AlternateGrubMenuFile /boot/grub/menu-suspended.lst
# BackupGrubMenuFile /boot/grub/menu.lst.hibernate.bak

# see http://bugs.debian.org/317479
# RemountXFSBoot yes

### hardware_tweaks
# IbmAcpi yes
# RadeonTool yes
# Runi915resolution yes
# FullSpeedCPU yes

### lilo
# EnsureLILOResumes yes

### lock (generally you only want one of the following options)
## For console you need vlock available.
## For x you need xscreensaver-command-command available.
## For gnome you need gnome-screensaver-command available.
## For kde you need dcop, kscreensaver available.
## For XAuto you need xautolock available.
## For Xtr you need xtrlock available.
## For Freedesktop (for example KDE4) you need dbus-send available
# LockConsoleAs root
# LockXScreenSaver yes
# LockGnomeScreenSaver yes
# LockFreedesktop
# LockKDE yes
# LockXLock yes
# LockXAutoLock yes
# LockXtrLock yes

### misclaunch
# OnSuspend 20 echo "Good night!"
# OnResume 20 echo "Good morning!"

### modules
# UnloadModules snd_via82cxxx usb-ohci
UnloadModules acpi_cpufreq mperf
# UnloadAllModules yes
UnloadBlacklistedModules yes
LoadModules auto
# LoadModulesFromFile /etc/modules

### modules-gentoo
# GentooModulesAutoload yes

### network
# DownInterfaces eth0
# UpInterfaces auto

### networkmanager
# EnableNMReconnect yes

### pause_audio
# MuteAudio yes
# PauseAudio yes

### pcmcia
# EjectCards yes

### programs
# IncompatiblePrograms xmms

### services
# RestartServices laptop_mode anacron
# StopServices alsasound
# StartServices aumix

### vbetool
# EnableVbetool yes
# RestoreVbeStateFrom /var/lib/vbetool/vbestate
# VbetoolPost yes
# RestoreVCSAData yes

### xhacks
SwitchToTextMode yes
# UseDummyXServer yes
# DummyXServerConfig xorg-dummy.conf

### xstatus
## This can be set to gnome, kde or x:
## For gnome you need zenity available.
## For kde you need dcop, kstart, kdialog available.
## For x you need to have xosd OR xmessage available.
# XStatus gnome
# XmessageDisable yes
# XSuspendText Preparing to suspend...
# XResumeText Resuming from suspend...
## When using XStatus x, and you have xosd installed:
# XosdSettings --font '-misc-fixed-medium-r-semicondensed--*-120-*-*-c-*-*-*' --colour=Green --shadow 1 --pos bottom --align center --offset 50

### xbacklight
# BackLight yes

### gaim
## You need to have dbus, gaim_remote available.
# LogoutGaim yes
# GaimRestoreStatus yes
# GaimLogoutMessage Hibernating
# GaimLoginMessage Back from hibernation

### pidgin
# LogoutPidgin yes
# PidginRestoreStatus yes
# PidginLogoutMessage Hibernating - bye!
# PidginLoginMessage I'm back!

### SSH and PGP keys
# AgentsClearGPG yes
# AgentsClearSSH yes

### Virtualbox
# SuspendVirtualbox yes

Offline

Board footer

Powered by FluxBB