core/cgroup: always submit unit to realize queue if all controllers are being invalidated

Alternative to #38190
Fixes #38112
This commit is contained in:
Mike Yuan
2025-07-12 17:39:14 +02:00
parent 77af13ffdb
commit e0d3213e09

View File

@@ -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;