__swap_cache_replace_folio(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ‘‘ __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:


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