Bug 30482
Summary: | try harder to free enough memory / improve image size autotuning | ||
---|---|---|---|
Product: | Power Management | Reporter: | Martin Steigerwald (Martin) |
Component: | Hibernation/Suspend | Assignee: | power-management_other |
Status: | CLOSED DOCUMENTED | ||
Severity: | normal | CC: | florian, lenb, rjw |
Priority: | P1 | ||
Hardware: | All | ||
OS: | Linux | ||
Kernel Version: | 2.6.36 | Subsystem: | |
Regression: | No | Bisected commit-id: | |
Bug Depends on: | |||
Bug Blocks: | 7216 | ||
Attachments: | PM / Hibernate: Refine autoestimation of image size |
Description
Martin Steigerwald
2011-03-05 14:38:52 UTC
Reported the hang as: Bug #30492 - kernel sometimes hangs on hibernation BTW this all is with in kernel suspend via hibernate script. I am using the following wrapper script for some of my own stuff: shambhala:/etc> cat acpi/hibernate-extra.sh #!/bin/sh # Zur Sicherheit gleich am Anfang alle ausstehenden Änderungen schreiben sync # Versuchen, möglichst viele LowMem Pages freizubekommen # Dir Entries legt Ext4 offenbar auch ins LowMem # Und mit zu wenig LowMem Pages klappt der Tiefschlaf mit # Radeon DRM KMS nicht. #echo 3 > /proc/sys/vm/drop_caches # Alternativ kleineres Image bauen, siehe LKML: # Re: does hibernate to disk try hard enough to free memory? (23.2.2011) echo 710000000 > /sys/power/image_size # Network Manager schlafen legen # siehe /usr/lib/pm-utils/sleep.d/55NetworkManager dbus-send --print-reply --system \ --dest=org.freedesktop.NetworkManager \ /org/freedesktop/NetworkManager \ org.freedesktop.NetworkManager.sleep # ifplugd stoppen #/etc/init.d/ifplugd stop #ifdown eth0 # Systemzeit in Hardware-Uhr speichern /etc/init.d/hwclock.sh stop # Uptimed stoppen, damit er die Rekorde schreibt /etc/init.d/uptimed stop # Zur Sicherheit hier nochmal alle ausstehenden Änderungen schreiben sync # Gutnacht # /etc/acpi/hibernate.sh #echo 1 > /sys/power/tuxonice/do_hibernate #pm-suspend-hybrid #pm-hibernate hibernate-disk # Uptimed wieder starten. Dabei schreibt er erneut die Rekorde /etc/init.d/uptimed start # Rekorde gleich schreiben sync # Festplatten-Parameter wieder setzen /etc/init.d/hdparm start # Systemzeit anhand Hardware-Uhr wieder setzen /etc/init.d/hwclock.sh start # Network Manager aufwecken dbus-send --print-reply --system \ --dest=org.freedesktop.NetworkManager \ /org/freedesktop/NetworkManager \ org.freedesktop.NetworkManager.wake # ifplugd starten #/etc/init.d/ifplugd start Created attachment 50132 [details]
PM / Hibernate: Refine autoestimation of image size
Please check if this patch helps.
Trying with patch now. Gives
martin@shambhala:~> cat /sys/power/image_size·
703229952
instead of:
> shambhala:~> cat /sys/power/image_size
> 844206080
Well one third instead of two fifths ;).
Well, seems to work now. I hibernated even with Iceweasel as well as KMail and Kontact open. Will do some more ridicolous attempts but until any issues show up, this new default seems to do fine here. Thanks. A patch referencing this bug report has been merged in v2.6.38-8876-g036a982: commit bea3864fb627d110933cfb8babe048b63c4fc76e Author: Rafael J. Wysocki <rjw@sisk.pl> Date: Tue Mar 15 00:45:46 2011 +0100 PM / Hibernate: Reduce autotuned default image size I have been testing with the patch for quite a while. It is still possible to provoke that a hibernation attempt fails and has to be retried, but it has become more unlikely. Is there a way for a more fundamental fix? I have the following ideas: 1) Can it be related to lowmem pages? Then a patch that explicitely show lowmem / highmem could help in diagnosing this. I might even be able to write such a patch, considering that its easy to get that info (I do not know kernel programming). 2) It seems to be related to driver allocations. And since I have this issue since switching my Radeon gfx setup to KMS it likely is the KMS / DRM driver in the kernel causing bigger allocations than before where hibernation even worked with two KDE 4 sessions at times at least. Does it make sense to open a bug report and ask whether the radeon KMS / DRM driver could free some pages upon hibernation? Or does it just allocate pages during that time that are absolutely needed? Any advice on how to proceed further? The problem is a consequence of bugs in device drivers that shouldn't allocate memory in their suspend/resume routines _at_ _all_. So, a more fundamental fix would be to modify drivers so that they use suspend/hibernate notifiers for allocating memory. IOW, you should complain to the developers of the drivers that cause problems to happen. Is there a way for me to determine which drivers are involved? Well since I have this since switching to radeon KMS it might probably just the radeon drm kms driver. Well I reported it as: Bug #34102 - radeon drm/kms: please use suspend/hibernate notifiers for allocating memory in suspend routines A patch referencing a commit referencing this bug report has been merged in v3.0-rc1: commit 1c1be3a949a61427a962771c85a347c822aeb991 Author: Rafael J. Wysocki <rjw@sisk.pl> Date: Sun May 15 11:39:48 2011 +0200 Revert "PM / Hibernate: Reduce autotuned default image size" |