]> git.ipfire.org Git - thirdparty/systemd.git/commit
core/cgroup: fix TasksMaxScale percentage serialization (#41011)
authorCyrus Xi <xi.cyrus@gmail.com>
Tue, 10 Mar 2026 18:36:21 +0000 (11:36 -0700)
committerGitHub <noreply@github.com>
Tue, 10 Mar 2026 18:36:21 +0000 (03:36 +0900)
commit9d15e09d5c5bf74eb9fefe1e9acf6e8422d5d200
tree40e031a49a528b297d1836437e6367a4e07daf1a
parentf6857cfaf234ea9e3d5821b5c15cbcdb0605ca1b
core/cgroup: fix TasksMaxScale percentage serialization (#41011)

bus_cgroup_set_tasks_max_scale() used a hand-rolled percentage format
that produced values ~10x too small (e.g., "TasksMax=4.0%" instead of
"TasksMax=40.00%").

On daemon-reload, the incorrect value was re-read, silently reducing
the effective TasksMax by ~10x and causing fork rejections on systems
with high thread counts.

Fix by using the existing PERMYRIAD macros, consistent with memory
property handlers (MemoryMax, MemoryHigh, MemoryLow, etc.).

Fixes: #41009
src/core/dbus-cgroup.c
test/units/TEST-19-CGROUP.tasks-max-scale.sh [new file with mode: 0755]