Re: [discuss] memrlimit - potential applications that can use

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: righi.andrea
Date: Wednesday, August 20, 2008 - 6:25 am

On 8/19/08, Dave Hansen <dave@linux.vnet.ibm.com> wrote:

Hi Dave,

IMHO there're two different problems, and both should be considered by
the kernel system wide as well as for each cgroup:

1) how to prevent OOM conditions
2) how to handle OOM conditions

The perfect solution for 2) doesn't exist IMHO, because there's no
clean way from the applications point of view to handle such critical
condition post-facto.

Containing the OOM within a cgroup is surely a great improvement, but
there's always the risk to kill the wrong applications (within the
cgroup). Another good improvement would be to handle the OOM condition
in userspace, Balbir is working/discussing/plannig something about
this, if I remember well.

An interesting solution, proposed in the past, was to send a special
signal to userspace apps to free up caches/buffers/unused mem when the
whole memory in the system goes under a critical threshold. But this
would require an active support by all the userspace applications,
that should implement the signal handler in a proper way. Maybe this
could be even considered a special case of the userspace OOM handling.

Memory overcommit protection, instead, is a way to *prevent* OOM
conditions (problem 1). This approach is safer for critical
applications that have a chance to cleanly handle the OOM at the time
they're requesting memory to the kernel, instead of receiving a
SIGKILL (or whatever signal) asynchronously during the execution path.
Unfortunately, this kind of prevention is not always acceptable,
because, in this case, userspace apps must request virtual memory
carefully, otherwise it would be quite easy to create memory DoS for
other applications (and probably the per-application/per-cgroup
RLIMIT_AS could help here).

As an example, an ideal solution I'd like to implement for a generic
enterprise environment is to create all the critical apps inside a
cgroup with never-overcommit memory policy and move all the other
userspace apps in another cgroup with oom-killer enabled. But for this
we need both 1) and 2) functionalities, and I don't see any other way
to do so.

-Andrea

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[discuss] memrlimit - potential applications that can use, Balbir Singh, (Tue Aug 19, 12:18 am)
Re: [discuss] memrlimit - potential applications that can use, righi.andrea, (Wed Aug 20, 6:25 am)
Re: [discuss] memrlimit - potential applications that can use, KAMEZAWA Hiroyuki, (Thu Aug 21, 12:43 am)
Re: [discuss] memrlimit - potential applications that can use, KAMEZAWA Hiroyuki, (Thu Aug 21, 3:59 am)