Re: [RFC PATCH] mm, oom: introduce vm.sacrifice_hugepage_on_oom

From: Chris Down
Date: Thu Feb 18 2021 - 09:44:27 EST


Eiichi Tsukata writes:
But that comes with a challenge: despite listening on cgroup for
pressure notifications (which happen from those runtime events we do
not control),

We do also have global pressure (PSI) counters. Have you tried to look
into those and try to back off even when the situation becomes critical?

Yes. PSI counters help us to some extent. But we've found that in some cases
OOM can happen before we observe memory pressure if memory bloat occurred
rapidly. The proposed failsafe mechanism can cover even such a situation.
Also, as I mentioned in commit message, oom notifiers doesn't work if OOM
is triggered by memory allocation for kernel.

Hmm, do you have free swap? Without it, we can trivially go from fine to OOM in a totally binary fashion. As long as there's some swap space available, there should be a clear period where pressure is rising prior to OOM.