Re: [PATCH v2] mm: introduce memory.min

From: Roman Gushchin
Date: Tue Apr 24 2018 - 10:37:08 EST


Hi Vladimir!

> On Mon, Apr 23, 2018 at 01:36:10PM +0100, Roman Gushchin wrote:
> > + memory.min
> > + A read-write single value file which exists on non-root
> > + cgroups. The default is "0".
> > +
> > + Hard memory protection. If the memory usage of a cgroup
> > + is within its effective min boundary, the cgroup's memory
> > + won't be reclaimed under any conditions. If there is no
> > + unprotected reclaimable memory available, OOM killer
> > + is invoked.
>
> What will happen if all tasks attached to a cgroup are killed by OOM,
> but its memory usage is still within memory.min? Will memory.min be
> ignored then?

Not really.

I don't think it's a big problem as long as a user isn't doing
something weird (e.g. moving processes with significant
amount of charged memory to other cgroups).

But what we can do here, is to ignore memory.min of empty cgroups
(patch below), it will resolve some edge cases like this.

Thanks!

--------------------------------------------------------------------------------