Skip to content

Commit 6a4e389

Browse files
authored
Merge pull request #1903 from sohankunkerkar/fix/enable-all-accounting-unconditionally
cgroup-systemd: enable all accounting properties to ensure stats are readable
2 parents efe1ceb + 0fc276c commit 6a4e389

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

src/libcrun/cgroup-systemd.c

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1753,18 +1753,12 @@ enter_systemd_cgroup_scope (runtime_spec_schema_config_linux_resources *resource
17531753

17541754
i = 0;
17551755
boolean_opts[i++] = "Delegate";
1756-
if (resources)
1757-
{
1758-
if (resources->cpu)
1759-
boolean_opts[i++] = "CPUAccounting";
1760-
if (resources->memory)
1761-
boolean_opts[i++] = "MemoryAccounting";
1762-
if (resources->block_io)
1763-
boolean_opts[i++] = "IOAccounting";
1764-
}
1765-
/* Always enable TasksAccounting to ensure the pids controller is available.
1766-
* This allows container managers to read pids.current even when no explicit
1767-
* pids limit is set. */
1756+
1757+
/* Always enable all accounting to ensure stats are readable even
1758+
* without resource limits. */
1759+
boolean_opts[i++] = "CPUAccounting";
1760+
boolean_opts[i++] = "MemoryAccounting";
1761+
boolean_opts[i++] = "IOAccounting";
17681762
boolean_opts[i++] = "TasksAccounting";
17691763
boolean_opts[i++] = NULL;
17701764

0 commit comments

Comments
 (0)