1,, SUSE Labs,, 20.09.2016,, ‹#› 20.09.2016 System suspend (and system resume, if you are lucky :-) Pavel Machek, SUSE Labs.

Slides:



Advertisements
Similar presentations
Introduction to Linux Recap Installing programs Introduction to Video Editing with Linux.
Advertisements

Genesis: from raw hardware to processes System booting sequence: how does a machine come into life.
Basic Input Output System
MCITP Guide to Microsoft Windows Server 2008 Server Administration (Exam #70-646) Chapter 11 Windows Server 2008 Virtualization.
Chapter 9 A Installing Linux. Synopsis What is needed. How to access the BIOS and boot a CD/DVD. How to repartition the hard drive. The Linux installation.
1 Web Server Administration Chapter 3 Installing the Server.
IT Systems Memory EN230-1 Justin Champion C208 –
SUSE Linux Enterprise Server Administration (Course 3037) Chapter 1 Introduction to Managing the SUSE Linux Enterprise Server.
CCNA 2 v3.1 Module 2.
Cambodia-India Entrepreneurship Development Centre - : :.... :-:-
The Operating System The operation system (OS) is a set of programs that coordinates: Hardware functions Interaction between application software and computer.
1 Introduction to Tool chains. 2 Tool chain for the Sitara Family (but it is true for other ARM based devices as well) A tool chain is a collection of.
Debugging techniques in Linux Debugging Techniques in Linux Chetan Kumar S Wipro Technologies.
1 Web Server Administration Chapter 3 Installing the Server.
Day 10 Hardware Fault Tolerance RAID. High availability All servers should be on UPSs –2 Types Smart UPS –Serial cable connects from UPS to computer.
Basic Input Output System
Hands-On Microsoft Windows Server 2008
Chocolate Bar! luqili. Milestone 3 Speed 11% of final mark 7%: path quality and speed –Some cleverness required for full marks –Implement some A* techniques.
Guide to Linux Installation and Administration, 2e1 Chapter 3 Installing Linux.
Chapter 7 Microsoft Windows XP. Windows XP Versions XP Home XP Home XP Professional XP Professional XP Professional 64-Bit XP Professional 64-Bit XP Media.
Computer Maintenance Unit Subtitle: Basic Input/Output System (BIOS) Excerpted from 1 Copyright © Texas Education Agency, All.
The PC The PC is a standard computing platform, built around a EISA bus (1988) –IBM compatible –“Intel Architecture” from Intel or AMD or other companies.
1 ITSK 2611 Welcome. 2 Operating System 3 What is an OS Resource Manager –Disk –Memory –CPU Device Manager –Printers –Video Card –Sound Card Utility.
Chapter Fourteen Windows XP Professional Fault Tolerance.
Linux Operations and Administration Chapter Fourteen Planning for a Linux Installation.
Ch 6. Performance Rating Windows 7 adjusts itself to match the ability of the hardware –Aero Theme v. Windows Basic –Gaming features –TV recording –Video.
Chap 1 ~ Introducing LINUX LINUX is a free-stable multi-user operating system that derives from UNIX operating system Benefits: 1) Linux is released under.
Bios Utkan Sürgevil
Implementing Hyper-V®
Presentation seminar on   Google Chrome OS is Linux based OS  Google Chrome is an open source, lightweight OS.  It is based.
Installation Overview Lab#2 1Hanin Abdulrahman. Installing Ubuntu Linux is the process of copying operating system files from a CD, DVD, or USB flash.
Chapter 2: Installation Overview Part 1. Installing Fedora/RHEL is the process of copying operating system files from media to the local system and setting.
Chapter 33 Troubleshooting Windows Errors. STOP Errors  When Microsoft Windows XP encounters a serious problem  And the operating system can't continue.
CHAPTER 2. Overview 1. Pre-Installation Tasks 2. Installing and Configuring Linux 3. X Server 4. Post Installation Configuration and Tasks.
Troubleshooting PC Hardware. Troubleshooting Steps 1. Identify the problem 2. Gather Information 3. Develop & implement a solution 4. If the problem isn't.
1 Copyright © 2015 Pexus LLC Patriot PS Personal Server Installing Patriot PS ISO Image on.
© GCSE Computing Computing Hardware Starter. Creating a spreadsheet to demonstrate the size of memory. 1 byte = 1 character or about 1 pixel of information.
Chapter 8: Installing Linux The Complete Guide To Linux System Administration.
Unit 1: Computing Fundamentals. Computer Tour-There are 7 major components inside a computer  Write down each major component as it is discussed.  Watch.
Computer Maintenance I
Why is my computer so slow? Find Reason and How You can Speed up Your Computer.
1 Setup and Compile Linux Kernel Speaker: Yi-Ji Jheng Date:
This slide deck is for LPI Academy instructors to use for lectures for LPI Academy courses. ©Copyright Network Development Group Module 10 Understanding.
A+ Guide to IT Technical Support, 9th Edition
Linux on ARM7TDMI or Nothing is as easy as it looks Helicon technologies Ltd. How to run uClinux on NXP LPC22xx.
PC Support & Repair Chapter 5 Operating Systems Part 2.
1,, SUSE Labs,, ,, ‹#› Sometimes it is good to be sleepy Pavel Machek, SUSE Labs.
Windows Vista Configuration MCTS : Maintenance and Optimization.
NT1110 Computer Structure and Logic Unit 8 (Module 5A) COMPUTER OPERATION AND SECURITY.
Operating System Kernel Compilation
Chapter Objectives In this chapter, you will learn:
Implementation of Embedded OS
Chapter Objectives In this chapter, you will learn:
Guide to Linux Installation and Administration, 2e
Seamless Guest OS's and more!
Memory Key Revision Points.
Power Management Discussion
Installation and Configuration
Building a Virtual Infrastructure
Improvement of startup time using Software Suspend - Project Update -
System suspend (short version) Pavel Machek, SUSE Labs 7/4/2018.
The PCI bus (Peripheral Component Interconnect ) is the most commonly used peripheral bus on desktops and bigger computers. higher-level bus architectures.
CONFIGURING HARDWARE DEVICE & START UP PROCESS
Operating System Kernel Compilation
TRANSLATORS AND IDEs Key Revision Points.
IS3440 Linux Security Unit 7 Securing the Linux Kernel
SUSE Linux Enterprise Desktop Administration
2.C Memory GCSE Computing Langley Park School for Boys.
Presentation transcript:

1,, SUSE Labs,, ,, ‹#› System suspend (and system resume, if you are lucky :-) Pavel Machek, SUSE Labs

2,, SUSE Labs,, ,, ‹#› 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,, SUSE Labs,, ,, ‹#› 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,, SUSE Labs,, ,, ‹#› 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,, SUSE Labs,, ,, ‹#› 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 rc1

6,, SUSE Labs,, ,, ‹#› 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,, SUSE Labs,, ,, ‹#› 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,, SUSE Labs,, ,, ‹#› 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,, SUSE Labs,, ,, ‹#› 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,, SUSE Labs,, ,, ‹#› 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,, SUSE Labs,, ,, ‹#› 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,, SUSE Labs,, ,, ‹#› How to get it to work... manually Get 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,, SUSE Labs,, ,, ‹#› 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,, SUSE Labs,, ,, ‹#› 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 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,, SUSE Labs,, ,, ‹#› 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,, SUSE Labs,, ,, ‹#› 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,, SUSE Labs,, ,, ‹#› 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,, SUSE Labs,, ,, ‹#› Questions? ?