Re: [PATCH] memcg: oom: ignore oom warnings from memory.max

From: Roman Gushchin
Date: Thu Apr 30 2020 - 16:23:46 EST


On Thu, Apr 30, 2020 at 03:30:49PM -0400, Johannes Weiner wrote:
> On Thu, Apr 30, 2020 at 12:06:10PM -0700, Roman Gushchin wrote:
> > On Thu, Apr 30, 2020 at 11:27:12AM -0700, Shakeel Butt wrote:
> > > @@ -6106,7 +6107,7 @@ static ssize_t memory_max_write(struct kernfs_open_file *of,
> > > }
> > >
> > > memcg_memory_event(memcg, MEMCG_OOM);
> > > - if (!mem_cgroup_out_of_memory(memcg, GFP_KERNEL, 0))
> > > + if (!mem_cgroup_out_of_memory(memcg, GFP_KERNEL, 0, true))
> >
> > I wonder if we can handle it automatically from the oom_killer side?
> > We can suppress warnings if oc->memcg is set and the cgroup scanning
> > showed that there are no belonging processes?
>
> Note that we do remote charging for certain consumers, where memory
> gets charged from the outside of the cgroup.
>
> We would want to know if these cause OOMs on an empty cgroup, rather
> than force-charge the allocations quietly.
>

Yeah, good point.