folio_alloc_swap(9)
π folio_alloc_swap(9) β like, the Kernel API Manual page, bestie π
okay so picture this: we're in the Kernel API Manual and this little icon is about to get swap space sorted for a folio. yes we're doing kernel memory management in the group chat. slay. π
β¨ NAME β¨
folio_alloc_swap β allocate swap space for a folio π¦
πΈ SYNOPSIS πΈ
int folio_alloc_swap (struct folio *folio );
literally copy that exactly, don't @ me about the spacing π
π ARGUMENTS π
- folio β the folio we want to move to swap. that's the whole vibe. she's the main character here π
β DESCRIPTION β
So what she does: allocate swap space for the folio, then add the folio to the swap cache. that's it, that's the function. two jobs, both iconic, no notes. β¨
π«Ά CONTEXT π«Ά
Heads up bestie: the caller needs to hold the folio lock before calling this. no lock, no entry. π
π RETURN π
Returns whether the folio was added to the swap cache. yes/no energy. iykyk. π
π₯ SEE ALSO π₯
Kernel file ./mm/swapfile.c β plus the whole friend group:
swap_put_entries_cluster(9)swap_dup_entries_cluster(9)folio_dup_swap(9)folio_put_swap(9)swap_entry_swapped(9)folio_free_swap(9)swap_put_entries_direct(9)swap_alloc_hibernation_slot(9)swap_free_hibernation_slot(9)pin_hibernation_swap_type(9)unpin_hibernation_swap_type(9)find_hibernation_swap_type(9)
okay that's the whole page!! π this lives under ./mm, it's from October 2026, and it's folio_alloc_swap(9) forever and always. go forth and swap your folios, bestie β ily, drink some water, and may your locks always be held π
ππ§ββοΈ
π¦ 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