Re: [patch] mm, oom: make a last minute check to prevent unnecessary memcg oom kills

From: Tetsuo Handa
Date: Wed Mar 11 2020 - 07:42:09 EST


On 2020/03/11 7:54, David Rientjes wrote:
> The patch certainly prevents unnecessary oom kills when there is a pending
> victim that uncharges its memory between invoking the oom killer and
> finding MMF_OOM_SKIP in the list of eligible tasks and its much more
> common on systems with limited cpu cores.

I think that it is dump_header() which currently spends much time (due to
synchronous printing) enough to make "the second memcg oom kill shows usage
is >40MB below its limit of 100MB" happen. Shouldn't we call dump_header()
and then do the last check and end with "but did not kill anybody" message?