Re: [patch -mm] mm, oom: add global access to memory reserves on livelock

From: David Rientjes
Date: Tue Aug 25 2015 - 19:41:36 EST


On Tue, 25 Aug 2015, Michal Hocko wrote:

> > I don't believe a solution that requires admin intervention is
> > maintainable.
>
> Why?
>

Because the company I work for has far too many machines for that to be
possible.

> > It would be better to reboot when memory reserves are fully depleted.
>
> The question is when are the reserves depleted without any way to
> replenish them. While playing with GFP_NOFS patch set which gives
> __GFP_NOFAIL allocations access to memory reserves
> (http://marc.info/?l=linux-mm&m=143876830916540&w=2) I could see the
> warning hit while the system still resurrected from the memory pressure.
>

If there is a holder of a mutex that then allocates gigabytes of memory,
no amount of memory reserves is going to assist in resolving an oom killer
livelock, whether that's partial access to memory reserves or full access
to memory reserves.

You're referring to two different conditions:

(1) oom livelock as a result of an oom kill victim waiting on a lock that
is held by an allocator, and

(2) depletion of memory reserves, which can also happen today without
this patchset and we have fixed in the past.

This patch addresses (1) by giving it a higher probability, absent the
ability to determine which thread is holding the lock that the victim
depends on, to make forward progress. It would be fine to do (2) as a
separate patch, since it is a separate problem, that I agree has a higher
likelihood of happening now to panic when memory reserves have been
depleted.

> I think an OOM reserve/watermark makes more sense. It will not solve the
> livelock but neithere granting the full access to reserves will. But the
> partial access has a potential to leave some others means to intervene.
>

Unless the oom watermark was higher than the lowest access to memory
reserves other than ALLOC_NO_WATERMARKS, then no forward progress would be
made in this scenario. I think it would be better to give access to that
crucial last page that may solve the livelock to make forward progress, or
panic as a result of complete depletion of memory reserves. That panic()
is a very trivial patch that can be checked in the allocator slowpath and
addresses a problem that already exists today.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/