From: Lennart Poettering Date: Thu, 22 Nov 2018 21:02:53 +0000 (+0100) Subject: cgroup: in unit_invalidate_cgroup() actually modify invalidation mask X-Git-Tag: v240~225^2~9 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e00068e71fcf33ccd9190cb18d1539cd921cf444;p=thirdparty%2Fsystemd.git cgroup: in unit_invalidate_cgroup() actually modify invalidation mask Previously this would manipulate the realization mask for invalidating the realization. This is a bit ugly though as the realization mask's primary purpose to is to reflect in which hierarchies a cgroup currently exists, and it's probably a good idea to keep that in sync with realities. We nowadays have the an explicit fields for invalidating cgroup controller information, the "cgroup_invalidated_mask", let's use this one instead. The effect is pretty much the same, as the main consumer of these masks (unit_has_mask_realize()) checks both anyway. --- diff --git a/src/core/cgroup.c b/src/core/cgroup.c index ec58d7820b4..0e198ce0259 100644 --- a/src/core/cgroup.c +++ b/src/core/cgroup.c @@ -2824,10 +2824,10 @@ void unit_invalidate_cgroup(Unit *u, CGroupMask m) { if (m & (CGROUP_MASK_CPU | CGROUP_MASK_CPUACCT)) m |= CGROUP_MASK_CPU | CGROUP_MASK_CPUACCT; - if ((u->cgroup_realized_mask & m) == 0) /* NOP? */ + if (FLAGS_SET(u->cgroup_invalidated_mask, m)) /* NOP? */ return; - u->cgroup_realized_mask &= ~m; + u->cgroup_invalidated_mask |= m; unit_add_to_cgroup_realize_queue(u); }