mark_oom_victim(9)
π mark_oom_victim(9) π
okay so bestie, welcome to the Kernel API Manual β this one's a short lil baddie but she's important, so let's get into it π
β¨ NAME β¨
mark_oom_victim β literally just marks the given task as an OOM victim. that's the whole gig. no cap π
πΈ SYNOPSIS πΈ
void mark_oom_victim (struct task_struct *tsk );
π¦ ARGUMENTS π¦
tskβ the task you're marking. that's it, that's the argument π«Ά
π₯ DESCRIPTION π₯
okay so here's the vibe check, and you HAVE to listen because this is the part where it gets real π
You have to call this with oom_lock held. Like, held held. Not "I'm pretty sure someone's holding it" β you hold it. And never, ever call it after oom has already been disabled. That's a hard no, not a soft no π
Also: tsk->mm has to be non NULL. Non. NULL. And the caller has to guarantee that it's stable β either by being under task_lock, or by operating on the current task. So like, you can't just vibe in there and hope the mm stays put, you have to actually guarantee it. main character energy but like, responsible π
fr fr though β those two conditions are the whole assignment.oom_lockheld β , not after oom is disabled β ,tsk->mmnon NULL β , stability guaranteed β . miss any of them and you're not slaying, you're just causing problems π
π SEE ALSO π
Kernel file ./mm/oom_kill.c, plus all these iconic siblings: oom_cpuset_eligible(9), oom_badness(9), dump_tasks(9), exit_oom_victim(9), oom_killer_enable(9), oom_killer_disable(9), out_of_memory(9) β
and that's the page!! this one comes from ./mm, dated October 2026, and honestly? she ate. go mark those victims 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