swap_cache_del_folio(9)
π swap_cache_del_folio(9) β the Kernel API Manual page you didn't know you needed π
okay so bestie, welcome to the swap_cache_del_folio(9) glow-up β¨ this is the Kernel API Manual page in question, and we're about to make it make sense. no cap.
β¨ NAME β¨
swap_cache_del_folio β literally just removes a folio from the swap cache. that's it. that's the whole vibe. π¦
πΈ SYNOPSIS πΈ
void swap_cache_del_folio (struct folio *folio );
she takes one (1) argument and returns nothing back to you. void main character energy, honestly π
π ARGUMENTS π
folioβ the folio. that's the folio in question. the folio we're talking about. yes, that one π«Ά
π DESCRIPTION π
so this is the same as __swap_cache_del_folio, except this version handles the lock and the refcount for you like the responsible icon it is π
π¨ but listen, bestie, this part is serious: the caller must ensure the folio is either clean or has a swap count equal to zero. if you don't? it may cause data loss. actual data loss. like, gone-gone. not playing around with this one ππ
π₯ CONTEXT π₯
the caller must ensure the folio is locked and in the swap cache. both. not one. both. this is the vibe check and you are not failing it π
π§ SEE ALSO π§
all of these live in the kernel file ./mm/swap_state.c:
swap_cache_get_folio(9)swap_cache_has_folio(9)swap_cache_get_shadow(9)__swap_cache_add_check(9)__swap_cache_add_folio(9)__swap_cache_del_folio(9)__swap_cache_replace_folio(9)swap_cache_alloc_folio(9)swap_update_readahead(9)swapin_sync(9)swap_cluster_readahead(9)swap_vma_readahead(9)swapin_readahead(9)
go read them. iykyk πβ¨
<anyway>and that's the whole page, bestie β brought to you from the ./mm source and dated October 2026, signed off with a swap_cache_del_folio(9) and a little π for the road. mwah π</anyway>
π¦ 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