__swap_cache_del_folio(9)
πΈ __swap_cache_del_folio β Kernel API Manual, section 9 πΈ
okay so bestie, welcome to the group chat for __swap_cache_del_folio(9) π
this one lives in the Kernel API Manual, section 9, and she is very specific about the vibes she needs from you before she'll do her thing. let's get into it π«Ά
β¨ NAME β¨
__swap_cache_del_folio β literally just removes a folio from the swap cache. that's the whole personality. iconic, honestly π
β¨ SYNOPSIS β¨
void __swap_cache_del_folio (struct swap_cluster_info *ci , struct folio
*folio , swp_entry_t entry , void *shadow );
no cap, that's the exact signature, don't come for me about the spacing π
β¨ ARGUMENTS β¨
four besties walk into the function:
ciβ the locked swap cluster. she's the one holding the entries, and yes, she needs to be locked, we'll get to that πfolioβ the folio. the main character. the whole reason we're here πentryβ the first swap entry that the folio corresponds to. like, the folio's origin story β¨shadowβ the shadow value that gets filled in the swap cache. it's giving filling-in-the-blank π¦
β¨ DESCRIPTION β¨
so what does she actually do? she removes a folio from the swap cache and fills a shadow in place β like, right there, no detour, no extra stop π
β οΈ but here's the thing, bestie: this won't put the folio's refcount. nope. not her job. the caller has to do that. so don't just walk away thinking it's handled, because it is not π
β¨ CONTEXT β¨
the pre-flight checklist, and please actually do it or things get weird π
caller must ensure:
- the folio is locked and in the swap cache using the index of
entryπ₯ - the cluster that holds the entries is locked π
that's the vibe check. pass it before you call her π
β¨ SEE ALSO β¨
sibling functions and the gang, all linked up π§:
kernel file ./mm/swap_state.c β and the whole friend group:
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)
and that's the page!! π she ships out of ./mm, dated October 2026, in section 9 of the Kernel API Manual β mwah, slay, 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