swap_cache_del_folio(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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:

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