Re: System freezes after OOM

From: David Rientjes
Date: Fri Jul 15 2016 - 17:22:08 EST


On Fri, 15 Jul 2016, Mikulas Patocka wrote:

> > Umm, show me an explicit guarantee where the oom reaper will free memory
> > such that other threads may return memory to this process's mempool so it
> > can make forward progress in mempool_alloc() without the need of utilizing
> > memory reserves. First, it might be helpful to show that the oom reaper
> > is ever guaranteed to free any memory for a selected oom victim.
>
> The function mempool_alloc sleeps with "io_schedule_timeout(5*HZ);"
>
> So, if the oom reaper frees some memory into the page allocator, the
> process that is stuck in mempoo_alloc will sleep for up to 5 seconds, then
> it will retry the allocation with "element = pool->alloc(gfp_temp,
> pool->pool_data)" (that will allocate from the page allocator) and succed.
>

No, the state of the 4.7 oom killer does not explicitly guarantee any
memory freeing of the victim and there is no guarantee that elements will
be returned to the mempool. If you're talking about patches that you're
proposing for the 4.8 merge window, please post them with complete
changelogs. Thanks.