mark_oom_victim(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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_lock held βœ…, not after oom is disabled βœ…, tsk->mm non 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