Re: user defined OOM policies

From: David Rientjes
Date: Mon Dec 02 2013 - 18:10:07 EST


On Thu, 28 Nov 2013, Michal Hocko wrote:

> > We already have hooks in the kernel oom killer, things like
> > /proc/sys/vm/oom_kill_allocating_task
>
> How would you implement oom_kill_allocating_task in userspace? You do
> not have any context on who is currently allocating or would you rely on
> reading /proc/*/stack to grep for allocation functions?
>

Not the exact behavior, sorry. I implemented oom_kill_allocating_task at
the request for SGI that simply wanted to avoid the lengthy tasklist scan,
they don't actually care what is killed as long as something is killed.
The actual allocating task is difficult to predict, especially in system
oom conditions, and their motivation was to make it as quickly as
possible. Userspace could certainly kill a random eligible process :)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/