lkml.org 
[lkml]   [2013]   [Dec]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [patch 1/2] mm, memcg: avoid oom notification when current needs access to memory reserves
On Tue, Dec 03, 2013 at 03:50:41PM -0800, David Rientjes wrote:
> On Tue, 3 Dec 2013, Michal Hocko wrote:
>
> > OK, as it seems that the notification part is too controversial, how
> > would you like the following? It reverts the notification part and still
> > solves the fault on exit path. I will prepare the full patch with the
> > changelog if this looks reasonable:
>
> Um, no, that's not satisfactory because it obviously does the check after
> mem_cgroup_oom_notify(). There is absolutely no reason why userspace
> should be woken up when current simply needs access to memory reserves to
> exit. You can already get such notification by memory thresholds at the
> memcg limit.
>
> I'll repeat: Section 10 of Documentation/cgroups/memory.txt specifies what
> userspace should do when waking up; one of those options is not "check if
> the memcg is still actually oom in a short period of time once a charging
> task with a pending SIGKILL or in the exit path has been able to exit."
> Users of this interface typically also disable the memcg oom killer
> through the same file, it's ludicrous to put the responsibility on
> userspace to determine if the wakeup is actionable and requires it to
> intervene in one of the methods listed in section 10.

Kind of a bummer that you haven't read anything I wrote...

But here is a patch that defers wakeups until we know for sure that
userspace action is required:

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index f1a0ae6..cc6adac 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -2254,8 +2254,17 @@ bool mem_cgroup_oom_synchronize(bool handle)

locked = mem_cgroup_oom_trylock(memcg);

+#if 0
+ /*
+ * XXX: An unrelated task in the group might exit at any time,
+ * making the OOM kill unnecessary. We don't want to wake up
+ * the userspace handler unless we are certain it needs to
+ * intervene, so disable notifications until we solve the
+ * halting problem.
+ */
if (locked)
mem_cgroup_oom_notify(memcg);
+#endif

if (locked && !memcg->oom_kill_disable) {
mem_cgroup_unmark_under_oom(memcg);

\
 
 \ /
  Last update: 2013-12-04 05:01    [W:0.091 / U:0.400 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site