0xff07
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # Power Management References - disk [TOC] ## Hibernation Basics Linux makes an image from current memory contents and system states using swap space. When user tries to resume, the make-shift image is loaded. As the system states are stored in persistence storage, memory can be powered off completely. This makes hibernation more power-saving than suspend-to-ram. On the other hand, resuming the system from contents in the disk may be slow. Thus resuming in general takes longer time. ## Setting up hibernation Because of its nature, hibernation is much trickier to set up. For example, you'll need a swap partion or swap file for the hibernation image. See See [*Hibernation*](https://wiki.archlinux.org/title/Power_management/Suspend_and_hibernate#Hibernation) in *Power management/Suspend and hibernate* from Arch Linux wiki. ## Behaviors The behavior of suspension can be obeserved in `dmesg` by runing `pm-hibernate` after enable the `/sys/power/pm_debug_messages`. The `pm-hibernate` is part of the `pm-utils` tool. You can install them on Ubuntu by: ``` $ sudo apt install pm-utils ``` To enable the `pm_debug_messages`, simply `cat` 1 into it: ``` $ sudo sh -c 'echo 1 > /sys/power/pm_debug_messages' ``` Doing this will enable extra messages regarding power management in the `dmesg`. Finally, to start doing hibernation: ``` $ sudo pm-hibernate ``` Note that the machine hasn't setup swap files properly, so those are not catual hiberanation behaviors. That being said, some notable differences between suspend-to-ram can already be observed. For example, fomr logs you could see kernel trying to create image for hibernation. ### Suspension Behavior ``` [ 486.343412] PM: hibernation: Configured hibernation resume from disk to 8388610 [ 486.343416] PM: hibernation: Hibernation image partition 8:2 present [ 486.343416] PM: hibernation: Looking for hibernation image. [ 486.343419] PM: Image not found (code -16) [ 486.343420] PM: hibernation: Hibernation image not present or could not be loaded. [ 486.343434] PM: hibernation: Hibernation mode set to 'platform' [ 486.414408] PM: hibernation: hibernation entry [ 486.430803] Filesystems sync: 0.016 seconds [ 486.430808] Freezing user space processes ... (elapsed 0.002 seconds) done. [ 486.432950] OOM killer disabled. [ 486.433076] PM: hibernation: Marking nosave pages: [mem 0x00000000-0x00000fff] [ 486.433079] PM: hibernation: Marking nosave pages: [mem 0x00058000-0x00058fff] [ 486.433080] PM: hibernation: Marking nosave pages: [mem 0x000a0000-0x000fffff] [ 486.433083] PM: hibernation: Marking nosave pages: [mem 0x63355000-0x63355fff] [ 486.433085] PM: hibernation: Marking nosave pages: [mem 0x63355000-0x63355fff] [ 486.433086] PM: hibernation: Marking nosave pages: [mem 0x78d01000-0x78d48fff] [ 486.433088] PM: hibernation: Marking nosave pages: [mem 0x78d5d000-0x78d8efff] [ 486.433090] PM: hibernation: Marking nosave pages: [mem 0x78e39000-0x78e8efff] [ 486.433093] PM: hibernation: Marking nosave pages: [mem 0x78ed4000-0x78efefff] [ 486.433095] PM: hibernation: Marking nosave pages: [mem 0x78f85000-0x78fdefff] [ 486.433098] PM: hibernation: Marking nosave pages: [mem 0x79000000-0xffffffff] [ 486.435101] PM: hibernation: Basic memory bitmaps created [ 486.435164] PM: hibernation: Preallocating image memory [ 487.293741] PM: hibernation: Allocated 1489814 pages for snapshot [ 487.293745] PM: hibernation: Allocated 5959256 kbytes in 0.85 seconds (7010.88 MB/s) [ 487.293747] Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done. [ 487.295314] printk: Suspending console(s) (use no_console_suspend to debug) [ 487.446347] PM: freeze of devices complete after 151.027 msecs [ 487.472987] PM: late freeze of devices complete after 26.634 msecs [ 487.473373] ACPI: EC: interrupt blocked [ 487.474286] PM: noirq freeze of devices complete after 1.263 msecs [ 487.474289] PM: end freeze of devices complete after 27.936 msecs [ 487.474290] ACPI: PM: Preparing to enter system sleep state S4 [ 487.474865] ACPI: EC: event blocked [ 487.474866] ACPI: EC: EC stopped [ 487.474866] ACPI: PM: Saving platform NVS memory [ 487.475044] Disabling non-boot CPUs ... [ 487.476593] smpboot: CPU 1 is now offline [ 487.487157] smpboot: CPU 2 is now offline [ 487.489168] smpboot: CPU 3 is now offline [ 487.494976] smpboot: CPU 4 is now offline [ 487.500770] smpboot: CPU 5 is now offline [ 487.502399] smpboot: CPU 6 is now offline [ 487.504000] smpboot: CPU 7 is now offline [ 487.504306] Checking wakeup interrupts [ 487.504308] Calling kvm_suspend+0x0/0x30 [kvm] [ 487.504347] Calling mce_syscore_suspend+0x0/0x20 [ 487.504350] Calling ledtrig_cpu_syscore_suspend+0x0/0x20 [ 487.504353] Calling timekeeping_suspend+0x0/0x2e0 [ 487.504384] Calling irq_gc_suspend+0x0/0x80 [ 487.504387] Calling save_ioapic_entries+0x0/0x170 [ 487.504455] Calling i8259A_suspend+0x0/0x40 [ 487.504459] Calling fw_suspend+0x0/0x20 [ 487.504461] Calling acpi_save_bm_rld+0x0/0x30 [ 487.504471] Calling intel_epb_save+0x0/0x40 [ 487.504473] Calling lapic_suspend+0x0/0x30 [ 487.504483] PM: hibernation: Creating image: [ 487.738865] PM: hibernation: Need to copy 1462837 pages [ 487.738867] PM: hibernation: Normal pages needed: 1462837 + 1024, available pages: 2699502 [ 489.139089] PM: hibernation: Image created (1462837 pages copied) ``` ### Resuming Behavior ``` [ 487.504861] ACPI: PM: Restoring platform NVS memory [ 487.504899] ACPI: EC: EC started [ 487.504900] Calling init_counter_refs+0x0/0x60 [ 487.504905] Calling lapic_resume+0x0/0x30 [ 487.504927] Calling intel_epb_restore+0x0/0x90 [ 487.504928] Calling acpi_restore_bm_rld+0x0/0x70 [ 487.504934] Calling irqrouter_resume+0x0/0x60 [ 487.504937] Calling i8259A_resume+0x0/0x40 [ 487.505081] Calling i8237A_resume+0x0/0xd0 [ 487.505143] Calling ioapic_resume+0x0/0x150 [ 487.505166] Calling irq_gc_resume+0x0/0x80 [ 487.505169] Calling irq_pm_syscore_resume+0x0/0x20 [ 487.505177] Calling timekeeping_resume+0x0/0x170 [ 487.505210] Timekeeping suspended for 0.951 seconds [ 487.505220] Calling ledtrig_cpu_syscore_resume+0x0/0x20 [ 487.505224] Calling mce_syscore_resume+0x0/0x30 [ 487.505237] Calling microcode_bsp_resume+0x0/0x70 [ 487.505240] Calling kvm_resume+0x0/0x30 [kvm] [ 487.505279] Enabling non-boot CPUs ... [ 487.505331] x86: Booting SMP configuration: [ 487.505332] smpboot: Booting Node 0 Processor 1 APIC 0x2 [ 487.511635] CPU1 is up [ 487.511672] smpboot: Booting Node 0 Processor 2 APIC 0x4 [ 487.516582] CPU2 is up [ 487.516612] smpboot: Booting Node 0 Processor 3 APIC 0x6 [ 487.521457] CPU3 is up [ 487.521487] smpboot: Booting Node 0 Processor 4 APIC 0x1 [ 487.526552] CPU4 is up [ 487.526580] smpboot: Booting Node 0 Processor 5 APIC 0x3 [ 487.531500] CPU5 is up [ 487.531531] smpboot: Booting Node 0 Processor 6 APIC 0x5 [ 487.536754] CPU6 is up [ 487.536782] smpboot: Booting Node 0 Processor 7 APIC 0x7 [ 487.541815] CPU7 is up [ 487.545327] ACPI: PM: Waking up from system sleep state S4 [ 487.547392] ACPI: EC: interrupt unblocked [ 487.566645] PM: noirq thaw of devices complete after 19.437 msecs [ 487.567123] PM: early thaw of devices complete after 0.417 msecs [ 487.567236] ACPI: EC: event unblocked [ 487.894462] ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 300) [ 487.895574] ata1.00: unexpected _GTF length (8) [ 487.896233] ata1.00: unexpected _GTF length (8) [ 487.896389] ata1.00: configured for UDMA/133 [ 491.095942] PM: thaw of devices complete after 3528.747 msecs [ 491.096252] PM: hibernation: Writing hibernation image. [ 491.097584] PM: Using 3 thread(s) for compression [ 491.097586] PM: Compressing and saving image data (1465695 pages)... [ 491.097593] PM: Image saving progress: 0% [ 491.674061] PM: Image saving progress: 10% [ 492.233351] PM: Image saving progress: 20% [ 493.631248] PM: Image saving progress: 30% [ 495.120169] PM: Image saving progress: 40% [ 496.439402] PM: Image saving progress: 50% [ 498.121164] PM: Image saving progress: 60% [ 499.713156] PM: Image saving progress: 70% [ 501.333536] PM: Image saving progress: 80% [ 501.676735] PM: hibernation: Wrote 5862780 kbytes in 10.57 seconds (554.66 MB/s) [ 501.878115] PM: hibernation: Basic memory bitmaps freed [ 501.878120] OOM killer enabled. [ 501.878121] Restarting tasks ... [ 501.878210] usb 2-4: USB disconnect, device number 2 [ 501.881219] done. [ 501.947069] video LNXVIDEO:00: Restoring backlight state [ 501.947267] PM: hibernation: hibernation exit ```

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully