From: Mike Yuan Date: Sat, 12 Jul 2025 15:39:14 +0000 (+0200) Subject: core/cgroup: always submit unit to realize queue if all controllers are being invalidated X-Git-Tag: v258-rc1~63^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e0d3213e09a97ec2bbf0dd2a6dfe58f08f6cb5d5;p=thirdparty%2Fsystemd.git core/cgroup: always submit unit to realize queue if all controllers are being invalidated Alternative to #38190 Fixes #38112 --- diff --git a/src/core/cgroup.c b/src/core/cgroup.c index c2f6f47e6e0..980d9b0f0ba 100644 --- a/src/core/cgroup.c +++ b/src/core/cgroup.c @@ -3950,7 +3950,11 @@ bool unit_invalidate_cgroup(Unit *u, CGroupMask m) { if (!crt) return false; - if (FLAGS_SET(crt->cgroup_invalidated_mask, m)) /* NOP? */ + /* If all controllers shall be invalidated, let's unconditionally submit the unit to realize queue. + * We initialize the field to _CGROUP_MASK_ALL after all, and semantically it makes sense to use + * it as a special signal to forcibly re-realize cgroup. */ + if (m != _CGROUP_MASK_ALL && + FLAGS_SET(crt->cgroup_invalidated_mask, m)) /* NOP? */ return false; crt->cgroup_invalidated_mask |= m;