__memcg1_swapout(9)
π __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:
foliomust 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:
memcg1_swapin(9)mem_cgroup_oom_synchronize(9)vmpressure_prio(9)vmpressure_register_event(9)vmpressure_unregister_event(9)
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
- 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