misc_cg_try_charge(9)
πΈ NAME πΈ
misc_cg_try_charge β bestie, this is the one that tries to charge the misc cgroup π
okay so real talk, the manual name is misc_cg_try_charge(9) and it lives in the Kernel API Manual β now let's get into it β¨
β¨ SYNOPSIS β¨
int misc_cg_try_charge (enum misc_res_type type , struct misc_cg *cg ,
u64 amount );
that's the whole signature, no cap π«Ά
π ARGUMENTS π
typeβ the misc res type you're charging. like, which resource bucket are we talking about πcgβ the misc cgroup that's gonna get charged. this is the one, the main character πamountβ how much you're charging. the actual number π
π¦ DESCRIPTION π¦
So you charge amount to the misc cgroup. Simple, iconic, done.
but like β the caller must use the same cgroup during the uncharge call. fr fr. same cgroup, or it's giving chaos π don't mix them up bestie.
π CONTEXT π
Any context. literally any. we don't gatekeep here π
β RETURN β
0β if it successfully charged. slay, it worked β¨-EINVALβ iftypeis invalid or the misc res has0capacity. not it π-EBUSYβ if the max limit will be crossed, or total usage will be more than the capacity. she's booked and busy, no room π
π SEE ALSO π
Kernel file ./kernel/cgroup/misc.c and its whole friend group:
parent_misc(9)valid_type(9)misc_cg_set_capacity(9)misc_cg_cancel_charge(9)misc_cg_uncharge(9)misc_cg_max_show(9)misc_cg_max_write(9)misc_cg_current_show(9)misc_cg_peak_show(9)misc_cg_capacity_show(9)misc_cg_alloc(9)misc_cg_free(9)
and that's the whole page, bestie π§π this came to you from ./kernel/cgroup, dated October 2026 β go forth and charge responsibly, iykyk ππ₯
π¦ 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