mem_cgroup_s...charge_folio(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… mem_cgroup_s...charge_folio(9) β€” Kernel API Manual ✨

okay so bestie, welcome to the kernel API manual, this one's about mem_cgroup_s...charge_folio(9) and it's genuinely so niche but so important 🫢


✨ NAME ✨

mem_cgroup_swapin_charge_folio β€” charge a newly allocated folio for swapin, no cap πŸ’Έ


πŸ¦‹ SYNOPSIS πŸ¦‹

int mem_cgroup_swapin_charge_folio (struct folio *folio , unsigned short
id , struct mm_struct *mm , gfp_t gfp );

πŸŽ€ ARGUMENTS πŸŽ€

  • folio β€” the folio to charge, that's the main character here πŸ‘‘
  • id β€” the memory cgroup id, iykyk
  • mm β€” mm context of the victim 😭
  • gfp β€” reclaim mode, literally the vibe check for reclaim

🌸 DESCRIPTION 🌸

So this function charges a folio that was allocated for swapin. That's it, that's the whole gig πŸ’–

⚠️ bestie pls listen: call this before adding the folio to the swapcache. Like, before. Not after. Periodt. πŸ™ˆ

It returns 0 on success. Otherwise, an error code comes back at you, and you deal with it 😭


πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./mm/memcontrol.c, plus the whole friend group right here 🫢


and that's the tea, bestie πŸ“ this page came from ./mm, dated October 2026, and it's filed right back under mem_cgroup_s...charge_folio(9) πŸ’œ slay, go charge those folios βœ¨πŸŽ€

πŸ“¦ where this page comes from