__mem_cgroup_uncharge_swap(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… __mem_cgroup_uncharge_swap (9) πŸ’…

okay bestie, so this is a page straight outta the Kernel API Manual, and it's giving "one tiny function that does exactly one thing" energy. iconic of it, honestly πŸŽ€


✨ NAME ✨

__mem_cgroup_uncharge_swap β€” uncharge swap space 🫢

That's it. That's the whole vibe. It uncharges swap space. no cap.


🌸 SYNOPSIS 🌸

void __mem_cgroup_uncharge_swap (unsigned short id , unsigned int
nr_pages );

return type is void, so it's not gonna hand you anything back β€” it just does the thing and dips πŸ’…


πŸ¦‹ ARGUMENTS πŸ¦‹

  • id β€” the cgroup id to uncharge. this is your "who are we uncharging" of the situation πŸ‘‘
  • nr_pages β€” the amount of swap space to uncharge. like, how much of it. a whole number of pages, specifically πŸ“

two args, both literally doing exactly what they say on the tin. we love a straightforward icon ✨


⭐ SEE ALSO ⭐

okay so the source of truth here is the kernel file ./mm/memcontrol.c and it has a lot of friends. like, an entire group chat. here's everybody:

bestie there are 37 of them, i counted, and yes you should probably go read the sibling __mem_cgroup_try_charge_swap(9) and __memcg_kmem_uncharge_page(9) if you're doing the whole charge/uncharge duo thing. iykyk πŸ’œ

🧚 sign-off 🧚

and that's the whole page!! it lives in ./mm, the manual's dated October 2026, and it's filed under that same __mem_cgroup_uncharge_swap(9) header we started with. slay, bye, go uncharge some swap πŸ’–πŸŒˆ


πŸ“¦ where this page comes from