Re: [PATCH v2] mm, memcg: skip killing processes under memcg protection at first scan

Yafang Shao
2019-08-21T01:01:17Z

On Wed, Aug 21, 2019 at 5:39 AM Roman Gushchin <guro@fb.com> wrote:
>
> On Sun, Aug 18, 2019 at 09:18:06PM -0400, Yafang Shao wrote:
> > In the current memory.min design, the system is going to do OOM instead
> > of reclaiming the reclaimable pages protected by memory.min if the
> > system is lack of free memory. While under this condition, the OOM
> > killer may kill the processes in the memcg protected by memory.min.
> > This behavior is very weird.
> > In order to make it more reasonable, I make some changes in the OOM
> > killer. In this patch, the OOM killer will do two-round scan. It will
> > skip the processes under memcg protection at the first scan, and if it
> > can't kill any processes it will rescan all the processes.
> >
> > Regarding the overhead this change may takes, I don't think it will be a
> > problem because this only happens under system memory pressure and
> > the OOM killer can't find any proper victims which are not under memcg
> > protection.
>
> Also, after the second thought, what your patch really does,
> it basically guarantees that no processes out of memory cgroups
> with memory.min set will be ever killed (unless there are any other
> processes). In most cases (at least on our setups) it's basically
> makes such processes immune to the OOM killer (similar to oom_score_adj
> set to -1000).
>

Actually it is between -999 and -1000.

> This is by far a too strong side effect of setting memory.min,
> so I don't think the idea is acceptable at all.
>

More possible OOMs is also a strong side effect (and it prevent us
from using it).
Leave all other works to the userspace is not proper.
We should improve it.

Thanks
Yafang