summaryrefslogtreecommitdiff
path: root/src/core/dbus-socket.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2018-11-23 01:07:34 +0100
committerLennart Poettering <lennart@poettering.net>2018-11-23 13:41:37 +0100
commit5af8805872809e6de4cc4d9495cb1a904772ab4e (patch)
tree9439dd6aa914bd1917d2a4db2e9dbf8b77c55148 /src/core/dbus-socket.c
parent8a0d538815b72563eb227fa21a67e78f5b290bfe (diff)
downloadsystemd-5af8805872809e6de4cc4d9495cb1a904772ab4e.tar.gz
cgroup: drastically simplify caching of cgroups members mask
Previously we tried to be smart: when a new unit appeared and it only added controllers to the cgroup mask we'd update the cached members mask in all parents by ORing in the controller flags in their cached values. Unfortunately this was quite broken, as we missed some conditions when this cache had to be reset (for example, when a unit got unloaded), moreover the optimization doesn't work when a controller is removed anyway (as in that case there's no other way for the parent to iterate though all children if any other, remaining child unit still needs it). Hence, let's simplify the logic substantially: instead of updating the cache on the right events (which we didn't get right), let's simply invalidate the cache, and generate it lazily when we encounter it later. This should actually result in better behaviour as we don't have to calculate the new members mask for a whole subtree whever we have the suspicion something changed, but can delay it to the point where we actually need the members mask. This allows us to simplify things quite a bit, which is good, since validating this cache for correctness is hard enough. Fixes: #9512
Diffstat (limited to 'src/core/dbus-socket.c')
-rw-r--r--src/core/dbus-socket.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/dbus-socket.c b/src/core/dbus-socket.c
index 4ea5b6c6e5..3819653908 100644
--- a/src/core/dbus-socket.c
+++ b/src/core/dbus-socket.c
@@ -461,7 +461,7 @@ int bus_socket_set_property(
int bus_socket_commit_properties(Unit *u) {
assert(u);
- unit_update_cgroup_members_masks(u);
+ unit_invalidate_cgroup_members_masks(u);
unit_realize_cgroup(u);
return 0;