lkml.org 
[lkml]   [2013]   [Nov]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: user defined OOM policies
On Thu, 21 Nov 2013, Michal Hocko wrote:

> > It's an interesting idea but unfortunately a non-starter for us because
> > our users don't have root,
>
> I wouldn't see this as a problem. You can still have a module which
> exports the notification interface you need. Including timeout
> fallback. That would be trivial to implement and maybe more appropriate
> to very specific environments. Moreover the global OOM handling wouldn't
> be memcg bound.
>

The memcg userspace oom handlers are effectively system userspace oom
handlers for everything at that memcg and its descendant memcgs, the
interface for the system oom handler and the memcg oom handlers would be
identical. We could certainly make the hook into a module by defining
some sort of API that could be exported, but I believe the proposal
empowers userspace to handle the oom situations in all possible scenarios
(notification, memory reserve, timeout) that it would stand alone as the
only user in the kernel of such an API and that API itself makes the code
unnecessarily complex.

> > we create their memcg tree and then chown it to the user. They can
> > freely register for oom notifications but cannot load their own kernel
> > modules for their own specific policy.
>
> yes I see but that requires just a notification interface. It doesn't
> have to be memcg specific, right?

They also need the memory reserve to do anything useful when the oom
handler wakes up, so you'd need an API exported to modules that allows you
to define the set of processes allowed to access such a reserve. So the
kernel code providing the needed functionality (notification, reserve,
timeout) remains constant for any possible userspace oom handler. Unless
you're thinking of a possible implementation that can't be addressed in
this way?


\
 
 \ /
  Last update: 2013-11-26 03:01    [W:1.258 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site