swap_alloc_hibernation_slot(9)
π swap_alloc_hibernation_slot(9) β like, the whole kernel API manual vibe β¨
okay bestie, welcome to the Kernel API Manual page for swap_alloc_hibernation_slot(9) β yes that's the real name and yes it's a mouthful, but we move π«Ά
πΈ NAME πΈ
swap_alloc_hibernation_slot β literally just allocates a swap slot for hibernation. that's the whole gig. iconic behaviour, no notes π
β¨ SYNOPSIS β¨
swp_entry_t swap_alloc_hibernation_slot (int type );
π ARGUMENTS π
typeβ the swap device type index you're allocating from. that's it, that's the argument π¦
π§ DESCRIPTION π§
okay so here's the thing, and it's lowkey important π β the caller has got to make sure the swap device is stable first. and there are exactly two ways to do that, no cap:
- by pinning it β that's
SWP_HIBERNATIONbabe π - or by freezing user-space βοΈ
do one of those, or don't come crying to me. main character energy only works when the device is stable, fr fr π
π₯ RETURN π₯
- a valid
swp_entry_ton success π - or an empty entry (
val == 0) on failure π
that's your vibe check right there β val == 0 means it did not slay π
π SEE ALSO π
kernel file ./mm/swapfile.c β and the whole friend group, all of these besties right here:
swap_put_entries_cluster(9)swap_dup_entries_cluster(9)folio_alloc_swap(9)folio_dup_swap(9)folio_put_swap(9)swap_entry_swapped(9)folio_free_swap(9)swap_put_entries_direct(9)swap_free_hibernation_slot(9)pin_hibernation_swap_type(9)unpin_hibernation_swap_type(9)find_hibernation_swap_type(9)
π reminder bestie: SWP_HIBERNATION pinning or freezing user-space β pick one, or the swap device is not stable and that's on you π«Ά
π and that's the page! source is ./mm, dated October 2026, and the whole thing is filed under swap_alloc_hibernation_slot(9) β mwah, periodt πβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms