[systemd-devel] How to correctly use memory controls (MemoryLow) on unified hierarchy system?

Benjamin Berg benjamin at sipsolutions.net
Sat May 22 10:28:01 UTC 2021


On Fri, 2021-05-21 at 20:14 +0300, Andrei Borzenkov wrote:
> On 21.05.2021 17:07, Benjamin Berg wrote:
> > [SNIP]
> > Yes, you need to set it on all ancestors, and the documentation
> > mentions this:
> > 
> > """
> > For a protection to be effective, it is generally required to
> > set a corresponding allocation on all ancestors, which is
> > then distributed between children (with the exception of the
> > root slice). Any MemoryMin= or MemoryLow= allocation that is
> > not explicitly distributed to specific children is used to
> > create a shared protection for all children. As this is a
> > shared protection, the children will freely compete for the
> > memory.
> > """
> > 
> 
> OK, it is in upstream now, was not in my version and I did not pay
> attention to web page. Sorry.

Ah, true, they were updated not too long ago.

> I guess I expected systemd to somehow handle it, given that it knows
> all the settings, knows exact hierarchy and is the sole master of
> cgroup tree.

I think it is a bit of a conundrum. Automatic handling would be neat,
but it also does not make sense that protections further up in the
hierarchy could increase indefinitely.
A somewhat ugly corner case are the automatically created slice units
for template services. Here the user will need to explicitly configure
a sane limit on the parent slice unit.

Benjamin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20210522/89447228/attachment.sig>


More information about the systemd-devel mailing list