New Linux kernel patch lets you cancel hibernation mid-process

RFC proposes power-button interrupt – and highlights wider problems with sleep states

Wed 22 Oct 2025 // 12:10 UTC

A new Linux kernel patch lets you cancel the process of your machine going into hibernation, but the bigger context of the work may be more important.

The new request for comments is from Collabora's Muhammad Anjum. Collabora does a lot of FOSS development, although its work on LibreOffice may be the most visible. (That may even speed up, as earlier this year, it merged with Allotropia, the company working on a WASM version of LibreOffice.)

Hibernation can take a while. As the RFC says, on Anjum's machine it takes about 20 seconds. The proposed change is simple: it adds a mechanism to cancel the process by pressing the power button. The thing is that for reasons Anjum goes on to explain, this is trickier than it sounds.

Hibernation is quite a tricky area in general. Ubuntu leaves it disabled by default, and has a lengthy page on debugging it. Hibernation problems can potentially be severe, causing data loss. For instance, some machines hibernate successfully, and then resume again successfully – but on waking, the keyboard and mouse may not work, leaving you locked out and unable to cleanly save your work. That's why some distros leave it off by default – anything else risks data loss. As such, if you enable it, you will probably want to try it out repeatedly, so being able to cancel the process sounds good to us.

We strongly suspect that people would find hibernation more reliable if they remembered to update their system firmware, but sadly, few bother to do this. These days, there's the very helpful fwupd toolkit, but this too has a snag – for the system or motherboard firmware, this requires UEFI boot mode. It also needs a large ESP, and we've seen it fail when there's not enough space. This means that fwupd is less help on the older machines, which arguably need it most.

As a result of these issues, hibernation support is a somewhat neglected area of Linux support. How it works is simple enough: when you tell your machine to hibernate, it saves all the data in memory onto the SSD or hard disk, plus a snapshot of the OS's state, and then turns off. It's the deepest of the four sleep levels defined by Intel. As the Arch wiki explains in detail, these are Suspend-to-Idle, Standby, Suspend-to-RAM, and Hibernation, also called Suspend-to-Disk.

The good thing about hibernation is that while a computer is in this state, it uses no power at all. You can even remove its battery – if you're using an old enough model of laptop where that's an option – and put it in your checked baggage, keeping only the battery in your carry-on luggage – as international regulations require, for good reason. (Just see this video of a fire in the overhead cabin after a lithium battery exploded, forcing an Air China flight to make an emergency landing earlier this week.)

However, there are downsides to hibernation too. Unlike Windows, Linux hibernates into whatever swap space you're using for virtual memory: a swap file or dedicated swap partition. That means hibernation needs a swap volume as big as the physical RAM in the computer. (This can vary – memory is compressed as it's stored so the code can't know in advance exactly how much space it will need.) So if your machine is actively using some swap space, you can't hibernate unless you've got enough empty swap available. For a heavily loaded system, that could mean you need more swap than RAM. Since modern PCs have tens to hundreds of gigabytes of RAM, there's normally little need for swap space at all – which means that having empty swap space lying around unused, just in case you want to hibernate your PC, seems like a waste of drive space.

Even with all these caveats, it's a useful tool, especially in the form of hybrid sleep, which is a clever hack that tries to deliver the best of both worlds. The gist of the hybrid sleep idea is that your machine creates a hibernation image on disk, then it suspends to RAM. If it has enough battery, when you wake it, it wakes from sleep, which is relatively fast; if the battery dies, then it wakes from hibernation instead. We're happy to see it getting some attention from a kernel developer, and we hope that it may in future become more common, rather than less. ®

Bootnote: how Windows does it

Windows uses a separate file to store the memory image. It's called C:\HIBERFIL.SYS. If you don't use Windows much, or you dual-boot and want to disable the troublesome fast startup feature, you can reclaim a few gigs by disabling hibernation. It takes just one command in an admin-mode command prompt window:

powercfg /h off
Get our Tech Resources

More about

TIP US OFF

Send us news


Other stories you might like

AltStyle によって変換されたページ (->オリジナル) /