chiark / gitweb /
cgroup: always invalidate "cpu" and "cpuacct" together
authorLennart Poettering <lennart@poettering.net>
Tue, 5 Sep 2017 09:17:01 +0000 (11:17 +0200)
committerSven Eden <yamakuzure@gmx.net>
Tue, 5 Sep 2017 09:17:01 +0000 (11:17 +0200)
This doesn't really matter, as we never invalidate cpuacct explicitly,
and there's no real reason to care for it explicitly, however it's
prettier if we always treat cpu and cpuacct as belonging together, the
same way we conisder "io" and "blkio" to belong together.

src/core/cgroup.c

index 01041d817e36bb853e6dc7f2bc0fef78d193fb8c..48f09658bfdf25d425556658bf01ba3ec10a205b 100644 (file)
@@ -2225,6 +2225,9 @@ void unit_invalidate_cgroup(Unit *u, CGroupMask m) {
         if (m & (CGROUP_MASK_IO | CGROUP_MASK_BLKIO))
                 m |= CGROUP_MASK_IO | CGROUP_MASK_BLKIO;
 
+        if (m & (CGROUP_MASK_CPU | CGROUP_MASK_CPUACCT))
+                m |= CGROUP_MASK_CPU | CGROUP_MASK_CPUACCT;
+
         if ((u->cgroup_realized_mask & m) == 0)
                 return;