]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/core/cgroup.c
unit: initialize bpf cgroup realization state properly
authorLennart Poettering <lennart@poettering.net>
Fri, 24 Nov 2017 18:51:36 +0000 (19:51 +0100)
committerLennart Poettering <lennart@poettering.net>
Sat, 25 Nov 2017 16:08:21 +0000 (17:08 +0100)
commit60c728adf7e716ca23e2d300d3955c60265a28c6
treefe9fad3a05cc16cd21a825b60f2978bf6b56249d
parent2aa57a655004c8f9fba48eeb71aa9a31fdf3c94b
unit: initialize bpf cgroup realization state properly

Before this patch, the bpf cgroup realization state was implicitly set
to "NO", meaning that the bpf configuration was realized but was turned
off. That means invalidation requests for the bpf stuff (which we issue
in blanket fashion when doing a daemon reload) would actually later
result in a us re-realizing the unit, under the assumption it was
already realized once, even though in reality it never was realized
before.

This had the effect that after each daemon-reload we'd end up realizing
*all* defined units, even the unloaded ones, populating cgroupfs with
lots of unneeded empty cgroups.

With this fix we properly set the realiazation state to "INVALIDATED",
i.e. indicating the bpf stuff was never set up for the unit, and hence
when we try to invalidate it later we won't do anything.
src/core/cgroup.c
src/core/unit.c