__swap_cache_replace_folio(9)
π __swap_cache_replace_folio(9) π
okay so this is a Kernel API Manual page, and it's giving βwe are replacing a folio in the swap cacheβ realness. not me being obsessed with folio replacement π
πΈ NAME πΈ
__swap_cache_replace_folio β replace a folio in the swap cache. periodt. π
β¨ SYNOPSIS β¨
void __swap_cache_replace_folio (struct swap_cluster_info *ci , struct
folio *old , struct folio *new );
π ARGUMENTS π
ciβ the locked swap cluster. like, it's already locked, bestie πoldβ the old folio to be replaced. bye-bye old one πnewβ the new folio. hiii new one β¨
π¦ DESCRIPTION π¦
so the whole vibe is: replace an existing folio in the swap cache with a new folio. π¦
The caller is responsible for setting up the new folio's flag and swap entries β that setup is literally on you, not on this function. Replacement will take the new folio's swap entry value as the starting offset to override all slots covered by the new folio. no cap, that's the whole description. π
π CONTEXT π
The caller must ensure both folios are locked, and must lock the cluster that holds the old folio to be replaced. like, these locks are non-negotiable ππ
π₯ SEE ALSO π₯
The kernel file is ./mm/swap_state.c, and the related-pages group chat is:
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_del_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)
okay that's the page π«Ά source/version: ./mm, date: October 2026, and the page name is __swap_cache_replace_folio(9). mwah π
π¦ 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