__memcg1_swapout(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… __memcg1_swapout(9)

okay so this is a page from the Kernel API Manual, and bestie, we're talking about __memcg1_swapout β€” the little function that transfers a memsw charge to swap. yes i know, very serious kernel business, but stay with me, it's actually iconic.


✨ SYNOPSIS ✨

void __memcg1_swapout (struct folio *folio , struct swap_cluster_info
*ci );

that's the whole signature, no cap. two args, both pointers, and it returns void β€” so like, nothing comes back, it just does the thing. πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • folio β€” the folio whose memsw charge we're transferring. this is the main character of the whole operation, fr fr. πŸ¦‹
  • ci β€” the locked swap cluster holding the swap entries. it's already locked, so don't you dare touch the lock, bestie. πŸ”’

🌸 DESCRIPTION 🌸

so what does it actually do? it transfers the memsw charge of folio over to the swap entry stored in folio->swap. that's it, that's the vibe. the charge packs its bags and moves to the swap entry. slay. ✨

ngl it's a short description because the function is a short function β€” sometimes less is more, and this is giving "confident, precise, knows exactly what it's doing" energy. πŸ‘‘


πŸ’€ CONTEXT πŸ’€

okay this part is highkey important so read it twice:

  • folio must be isolated, unmapped, locked, and is just about to be freed.
  • the caller must disable IRQs.
  • the caller must hold the swap cluster lock.
🫢 requirements check before you call this, bestie β€” it's not optional. the folio is literally about to be freed, so the state has to be exactly right or things get extremely not-cute. πŸ™ˆ

πŸ¦‹ SEE ALSO πŸ¦‹

go read these next, they're all in the kernel file ./mm/memcontrol-v1.c and they're all part of the same little friend group:


and that's the page! πŸ’– this one lives in ./mm and the version/date on it is October 2026, which honestly feels like a future vibe but here we are. stay charged (memsw-ly speaking), lock your clusters, and i'll see you in the next manpage. mwah! πŸ’…πŸŽ€

πŸ“¦ where this page comes from