mem_cgroup_get_oom_group(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– mem_cgroup_get_oom_group(9) πŸ’–

okay so this is a page from the Kernel API Manual, and honestly? it's a little baddie. it's called mem_cgroup_get_oom_group and it's giving "who do we gotta yeet when memory runs out" energy. let's get into it 🫢


✨ NAME ✨

mem_cgroup_get_oom_group β€” get a memory cgroup to clean up after OOM

like, literally what the name says bestie, it grabs you the memcg that needs the cleanup after an out-of-memory situation πŸ’…


🌸 SYNOPSIS 🌸

struct mem_cgroup * mem_cgroup_get_oom_group (struct task_struct *victim
, struct mem_cgroup *oom_domain );

look at that signature, she's iconic πŸ”₯


πŸŽ€ ARGUMENTS πŸŽ€

  • victim β€” the task that the OOM killer is gonna kill 😭 that's the whole vibe, it's the sacrifice
  • oom_domain β€” the memcg when it's a memcg OOM, or NULL when it's a system-wide OOM. two moods, one param πŸ¦‹

πŸ’œ DESCRIPTION πŸ’œ

So it returns a pointer to a memory cgroup, right? and that cgroup has to be cleaned up by killing all the belonging OOM-killable tasks. no cap, that's the job, that's the assignment πŸ’€

⚠️ important bestie: the caller has to call mem_cgroup_put on the returned non-NULL memcg. not "should", not "maybe" β€” has to. don't leave her hanging πŸ™ˆ

🌈 SEE ALSO 🌈

okay this list is LONG, she ate and left no crumbs πŸ‘‘. Kernel file ./mm/memcontrol.c, plus:


and that's the whole page, bestie!! ✨ source is ./mm, dated October 2026, and this little moment of kernel lore is officially over πŸ’– go call mem_cgroup_put like the good noodle you are 🧚🌟

πŸ“¦ where this page comes from