Download presentation
Presentation is loading. Please wait.
Published byNoah Woods Modified over 8 years ago
1
1,, SUSE Labs,, 20.09.2016,, ‹#› 20.09.2016 System suspend (and system resume, if you are lucky :-) Pavel Machek, SUSE Labs
2
2,, SUSE Labs,, 20.09.2016,, ‹#› Standby Easy but useless... * a.k.a. S1 * not even cpu state is lost * no need to mess with drivers (modulo bugs) * how do you tell ancient machine? [it supports S1] cat /proc/acpi/sleep echo 1 > /proc/acpi/sleep (if it breaks, you have buggy hardware, or acpi problems. Toshiba 4030cdt?)
3
3,, SUSE Labs,, 20.09.2016,, ‹#› Suspend to RAM a.k.aa.k.a. S3 we have enough kernel support that it works on most machines, with exception of video ugly hacks were developed to fix video better keep them in userland suspend.sf.net tries to integrate them in easy-to-use package being easy-to-use introduced problems on lots of strange machines, Stefan Seyfried is working with users on expanding whitelist. contains DMI-based whitelist of notebooks
4
4,, SUSE Labs,, 20.09.2016,, ‹#› Using suspend to RAM./s2ram If it does not work, see opensuse website for nice troubleshooting guide. what to do with desktops? Match both DMI and PCI ID of the video card? What about multihead setups? HAL integration?
5
5,, SUSE Labs,, 20.09.2016,, ‹#› Brief history 'Software suspend' or 'Swap suspend' Swsusp * suspend-to-disk done by linux kernel, does not need BIOS support * originally for 2.4.X by Gabor Kuti * Nigel forked suspend2 * I created proof-of-concept uswsusp-like patches in late 2006 * Rafael added uswsusp in 2.6.17-rc1
6
6,, SUSE Labs,, 20.09.2016,, ‹#› Swsusp Very simple, in-kernel implementation, deprecated Can use swap partition (no need for dedicated partition) Faster than BIOS suspend-to-disk (but slower than suspend2/uswsusp) Supports SMP, HIGHMEM, etc i386, x86-64, frv, ppc32 optionaly saves up to 50% of memory (including caches) stable SuSE ships/supports it (in openSUSE <= 10.1) Fedora ships it still possible to shoot yourself into the foot, fortunately distros make it hard
7
7,, SUSE Labs,, 20.09.2016,, ‹#› Nigel's suspend2 All the features possible, and then some more Up to 100% of memory saved Encryption, compression support Can suspend to regular file and swapfile Bootsplash integration, esc aborts suspend Complex 14K LoC of kernel code Homebrew plugins support UI in kernel
8
8,, SUSE Labs,, 20.09.2016,, ‹#› How swsusp works suspend: * stop all user processes, free at least 50% of memory * stop all nonboot CPUs * suspend devices * copy HIGHMEM down, atomically copy memory image * resume devices, write image to disk * suspend devices and poweroff resume: * boot normally, but read image just before mounting * copy memory back atomically, then copy HIGHMEM back * resume all CPUs * resume devices
9
9,, SUSE Labs,, 20.09.2016,, ‹#› uSwsusp Allows userland to do all the hard work Kernel only exports low-level functions This allows to keep kernel complexity low (~1K LoC) whileretaining flexibility Userland code available at suspend.sf.net Supports compression, encryption (password only asked during resume), suspend to file (slightly hacky, -mm?) Abort by key, bootsplash support Suspending over network should be doable without kernel patches
10
10,, SUSE Labs,, 20.09.2016,, ‹#› Suspend to both uSwsusp enables us to support „store image on disk, then suspend to RAM“ gets you fast resume, without risk of loosing data when battery runs flat Experimental, but quite simple Relies on s2ram being single binary
11
11,, SUSE Labs,, 20.09.2016,, ‹#› SUSE releases swsusp used in suse10.1 and older s2ram first appeared in suse10.2, but with small whitelist uswsusp used in suse10.2+ of course, swsusp should still work, too. But it is not default try suse10.3 alpha in case of problems
12
12,, SUSE Labs,, 20.09.2016,, ‹#› How to get it to work... manually Get 2.6.20 sources You'll need just one swap partition swapfiles & more than one partitions are possible with new tools Append resume=/dev/hdaX to kernel command line Test in-kernel swsusp by echo disk > /sys/power/state (this really should work, debug it if not) Compile & install package from suspend.sf.net (see HOWTO)./suspend /dev/swap-partition should do the right thing now Try./s2ram
13
13,, SUSE Labs,, 20.09.2016,, ‹#› Debugging If your machine is infected with binary modules desinfect. Donate $10 to FSF. Buy Intel machine next time. If you are not using latest stable kernel upgrade. suse10.3 alpha is reasonably recent (as of 2007/03) Try suspending from init 3 if it helps, X or module problem is suspected. Go debug. Try suspending from init=/bin/bash if it helps, binary search for broken module Try noapic, nolapic, acpi=off (swsusp case), maxcpus=1, mem=700M
14
14,, SUSE Labs,, 20.09.2016,, ‹#› Debugging s2ram s2ram -f is the safest thing to do but you often get no video...so test if system is alive using capslock. Watch for disk lights. Try typing commands blindly In case of video problems, follow http://en.opensuse.org/S2ram or just try all the s2ram options ;-) beeping patch tells you if kernel received control after resume or not if not, you are in trouble. Probably ACPI problem. if so, set up serial console, or use PM_TRACE infrastructure
15
15,, SUSE Labs,, 20.09.2016,, ‹#› Debugging swsusp Try swsusp before debugging uswsusp Read the docs in Documentation/power increase console loglevel and/or disable klogd to see messages echo shutdown > /sys/power/disk to rule out ACPI problems echo testproc... tests refrigerator and cpu hotplug. Should work. echo test... tests drivers, too. You can use it to speed up binary search for broken module.
16
16,, SUSE Labs,, 20.09.2016,, ‹#› Future work Fix the remaining bugs ? suspend to RAM, wakeup in half an hour, suspend to disk ? when battery gets too low during suspend to RAM, wakeup and suspend to disk I condsider both these features dangerous, your notebook could wakeup at the wrong time and start writing to its disk (like when aircraft lands)
17
17,, SUSE Labs,, 20.09.2016,, ‹#› Future work – s2ram Whitelist needs expanding Problematic/strange machines still exist and are common can only resume from X can only resume from vga=0 console Drivers still need to be improved bluetooth causes problems most SCSI drivers will probably break suspend binary-only modules are evil
18
18,, SUSE Labs,, 20.09.2016,, ‹#› Questions? ?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.