obj_cgroup_charge_zswap(9)
π obj_cgroup_charge_zswap(9) β the Kernel API Manual situation
okay so bestie, welcome to the obj_cgroup_charge_zswap(9) page π this is a Kernel API Manual moment, and honestly? it's short, it's sweet, it does exactly one thing. main character energy fr fr.
β¨ NAME β¨
obj_cgroup_charge_zswap β charge compression backend memory π§
πΈ SYNOPSIS πΈ
void obj_cgroup_charge_zswap (struct obj_cgroup *objcg , size_t size );
that's it. that's the whole signature. void in, void out, no takebacks. π
π¦ ARGUMENTS π¦
objcgβ the object cgroup π like, the cgroup in question, the one we're doing all this for.sizeβ size of compressed object π yes bestie, we're talking about the compressed one specifically.
π DESCRIPTION π
so here's the tea β this function forces the charge. like, no more asking nicely, the charge is happening.
but context matters, so let me set the scene: obj_cgroup_may_zswap has to have already allowed compression and storage in zswap for this cgroup to go ahead. that's the green light, that's the vibe check that passed. once that's done, obj_cgroup_charge_zswap comes in and makes the charge actually go through. periodt. π₯
ngl that's genuinely the whole description. no cap, that's it. don't go looking for a hidden paragraph, there isn't one π
π SEE ALSO π
okay this is the part where the manpage goes absolutely feral with cross-references π like, grab a snack, this list is long. every single one of these is a (9) situation:
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)__mem_cgroup_uncharge_swap(9)obj_cgroup_may_zswap(9)obj_cgroup_uncharge_zswap(9)
also, for the record, the kernel file is ./mm/memcontrol.c β that's where this lives, iykyk π
and deadass, the natural follow-ups here are obj_cgroup_may_zswap(9) (the permission slip) and obj_cgroup_uncharge_zswap(9) (the undo button), so if you're reading this page you're probably reading those too π«Ά
β the sign-off β
this whole thing comes courtesy of ./mm, dated October 2026, and it's filed under obj_cgroup_charge_zswap(9) β so if you memorise one thing today, memorise that it charges compression backend memory, and that it's the forceful follow-up to obj_cgroup_may_zswap saying yes πβ¨ slay, go charge something, bestie π
πΈ
π¦ 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