# Power Management References - deep [TOC] ## Notes Sometimes "suspend-to-ram" refers to this. This is what happens if: 1. The `/sys/power/mem_sleep` is set to `deep`; and 2. `mem` is written to `/sys/power/state`. ### Suspension logs Suspend-to-ram in general requires platform support. One notable behavior is that the non-booting processor or taken offline. ```dmesg [ 147.319976] PM: suspend entry (deep) [ 147.355021] Filesystems sync: 0.035 seconds [ 147.359142] Freezing user space processes [ 147.361191] Freezing user space processes completed (elapsed 0.002 seconds) [ 147.361196] OOM killer disabled. [ 147.361197] Freezing remaining freezable tasks [ 147.362351] Freezing remaining freezable tasks completed (elapsed 0.001 seconds) [ 147.362392] printk: Suspending console(s) (use no_console_suspend to debug) [ 147.476298] sd 0:0:0:0: [sda] Synchronizing SCSI cache [ 147.502014] ata1.00: Entering standby power mode [ 147.716431] PM: suspend of devices complete after 353.883 msecs [ 147.716448] PM: start suspend of devices complete after 354.152 msecs [ 147.728258] PM: late suspend of devices complete after 11.811 msecs [ 147.728574] ACPI: EC: interrupt blocked [ 147.812310] PM: noirq suspend of devices complete after 84.008 msecs [ 147.812314] ACPI: PM: Preparing to enter system sleep state S3 [ 147.920421] ACPI: EC: event blocked [ 147.920422] ACPI: EC: EC stopped [ 147.920423] ACPI: PM: Saving platform NVS memory [ 147.920443] Disabling non-boot CPUs ... [ 147.921744] smpboot: CPU 1 is now offline [ 147.923644] smpboot: CPU 2 is now offline [ 147.925155] smpboot: CPU 3 is now offline [ 147.925397] Checking wakeup interrupts [ 147.925400] Calling kvm_suspend+0x0/0x40 [kvm] [ 147.925458] Calling mce_syscore_suspend+0x0/0x20 [ 147.925461] Calling ledtrig_cpu_syscore_suspend+0x0/0x20 [ 147.925465] Calling timekeeping_suspend+0x0/0x310 [ 147.925502] Calling irq_gc_suspend+0x0/0x80 [ 147.925504] Calling save_ioapic_entries+0x0/0x170 [ 147.925625] Calling i8259A_suspend+0x0/0x40 [ 147.925629] Calling fw_suspend+0x0/0x20 [ 147.925631] Calling acpi_save_bm_rld+0x0/0x30 [ 147.925636] Calling intel_epb_save+0x0/0x40 [ 147.925639] Calling lapic_suspend+0x0/0x30 ``` ### Resume logs The resume process pretty much unwind what suspension has done. ```dmesg [ 147.926320] ACPI: PM: Low-level resume complete [ 147.926352] ACPI: EC: EC started [ 147.926353] ACPI: PM: Restoring platform NVS memory [ 147.926359] Calling init_counter_refs+0x0/0x60 [ 147.926367] Calling lapic_resume+0x0/0x30 [ 147.926390] Calling intel_epb_restore+0x0/0xb0 [ 147.926395] Calling acpi_restore_bm_rld+0x0/0x70 [ 147.926401] Calling irqrouter_resume+0x0/0x60 [ 147.926407] Calling i8259A_resume+0x0/0x40 [ 147.926544] Calling i8237A_resume+0x0/0xc0 [ 147.926622] Calling ioapic_resume+0x0/0x150 [ 147.926677] Calling irq_gc_resume+0x0/0x80 [ 147.926682] Calling irq_pm_syscore_resume+0x0/0x20 [ 147.926750] Calling timekeeping_resume+0x0/0x1b0 [ 147.926790] Timekeeping suspended for 3.123 seconds [ 147.926807] Calling ledtrig_cpu_syscore_resume+0x0/0x20 [ 147.926815] Calling mce_syscore_resume+0x0/0x30 [ 147.926833] Calling microcode_bsp_resume+0x0/0x50 [ 147.926839] Calling kvm_resume+0x0/0x70 [kvm] [ 147.926999] Enabling non-boot CPUs ... [ 147.927041] smpboot: Booting Node 0 Processor 1 APIC 0x2 [ 147.966947] CPU1 is up [ 147.967290] smpboot: Booting Node 0 Processor 2 APIC 0x1 [ 147.968447] CPU2 is up [ 147.968467] smpboot: Booting Node 0 Processor 3 APIC 0x3 [ 148.001286] CPU3 is up [ 148.004216] ACPI: PM: Waking up from system sleep state S3 [ 148.006020] ACPI: EC: interrupt unblocked [ 149.117600] PM: noirq resume of devices complete after 1112.019 msecs [ 149.117911] PM: early resume of devices complete after 0.250 msecs [ 149.117985] ACPI: EC: event unblocked [ 149.253240] PM: resume of devices complete after 135.351 msecs [ 149.254129] OOM killer enabled. [ 149.254136] Restarting tasks ... done. [ 149.262149] random: crng reseeded on system resumption [ 149.364034] PM: suspend exit ``` ## References ### [Evolution of Suspend-to-Idle Support in The Linux Kernel - Rafael Wysocki (LCA 2021 Online)](https://youtu.be/wvcM-Uf3DBU) {%youtube wvcM-Uf3DBU %}