__mem_cgroup_uncharge_swap(9)
π
__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:
get_mem_cgroup_css_from_folio(9)page_cgroup_ino(9)lruvec_page_state_monotonic(9)mod_memcg_state(9)mod_lruvec_state(9)count_memcg_events(9)get_mem_cgroup_from_mm(9)get_mem_cgroup_from_current(9)get_mem_cgroup_from_folio(9)mem_cgroup_iter(9)mem_cgroup_iter_break(9)mem_cgroup_scan_tasks(9)folio_lruvec_lock(9)folio_lruvec_lock_irq(9)folio_lruvec_lock_irqsave(9)mem_cgroup_update_lru_size(9)mem_cgroup_margin(9)mem_cgroup_print_oom_context(9)mem_cgroup_print_oom_meminfo(9)mem_cgroup_get_oom_group(9)consume_stock(9)__memcg_kmem_charge_page(9)__memcg_kmem_uncharge_page(9)mem_cgroup_wb_stats(9)mem_cgroup_from_private_id(9)mem_cgroup_css_reset(9)mem_cgroup_calculate_protection(9)mem_cgroup_charge_hugetlb(9)mem_cgroup_swapin_charge_folio(9)mem_cgroup_replace_folio(9)mem_cgroup_migrate(9)mem_cgroup_sk_charge(9)mem_cgroup_sk_uncharge(9)__mem_cgroup_try_charge_swap(9)obj_cgroup_may_zswap(9)obj_cgroup_charge_zswap(9)obj_cgroup_uncharge_zswap(9)
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
- 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