Re: [patch v3] mm, oom: fix unnecessary killing of additional processes

From: Michal Hocko
Date: Fri Jul 06 2018 - 01:39:08 EST


On Thu 05-07-18 16:46:21, Andrew Morton wrote:
> On Thu, 21 Jun 2018 14:35:20 -0700 (PDT) David Rientjes <rientjes@xxxxxxxxxx> wrote:
>
> > The oom reaper ensures forward progress by setting MMF_OOM_SKIP itself if
> > it cannot reap an mm. This can happen for a variety of reasons,
> > including:
> >
> > - the inability to grab mm->mmap_sem in a sufficient amount of time,
> >
> > - when the mm has blockable mmu notifiers that could cause the oom reaper
> > to stall indefinitely,
> >
> > but we can also add a third when the oom reaper can "reap" an mm but doing
> > so is unlikely to free any amount of memory:
> >
> > - when the mm's memory is mostly mlocked.
>
> Michal has been talking about making the oom-reaper handle mlocked
> memory. Where are we at with that?

I didn't get to mlocked memory yet because blockable mmu notifiers are
more important. And I've already posted patch for that and it is under
discussion [1]. Mlocked memory is next.

[1] http://lkml.kernel.org/r/20180627074421.GF32348@xxxxxxxxxxxxxx

Btw. I still hate this patch and making any timeout user defineable. It
is a wrong approach and my nack to this patch still applies.

--
Michal Hocko
SUSE Labs