Repository navigation
core/cgroup: fix TasksMaxScale percentage serialization - #41011
Conversation
|
@claude review |
Claude review of PR #41011 (f0dbd84)The fix is correct. The old code computed CI: all completed checks pass; build test, mkosi, CodeQL, and CIFuzz still in progress. Nits
|
|
@Cyrus-Xi please add a test to |
|
@Cyrus-Xi please squash all commits into one. |
|
added test and squashed commits into 1 edit: made executable to fix failing CI |
9df1b5f to
635f004
Compare
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: systemd#41009
|
Hmm, the commit message has spurious indent. Let's fix it on merge (by using squash merge). |
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: systemd#41009 (cherry picked from commit 9d15e09)
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: systemd#41009 (cherry picked from commit 9d15e09)
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 (cherry picked from commit 9d15e09)
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: systemd#41009 (cherry picked from commit 9d15e09) (cherry picked from commit 7102649)
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 (cherry picked from commit 9d15e09) (cherry picked from commit 7102649)
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: systemd#41009 (cherry picked from commit 9d15e09) (cherry picked from commit 7102649) (cherry picked from commit 8498799)
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: systemd#41009 (cherry picked from commit 9d15e09) (cherry picked from commit 7102649) (cherry picked from commit 8498799)
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 (cherry picked from commit 9d15e09) (cherry picked from commit 7102649) (cherry picked from commit 8498799)
bus_cgroup_set_tasks_max_scale()uses a hand-rolled percentage format that produces values ~10x toosmall (e.g.,
TasksMax=4.0%instead ofTasksMax=40.00%).The function computes whole-percent values (
scaled = v * 100 / UINT32_MAX) but the format stringtreats them as tenths-of-percent (
scaled/10 . scaled%10). On daemon-reload, the incorrect value isre-read, silently reducing the effective TasksMax by ~5-10x.
Fix by replacing with
UINT32_SCALE_TO_PERMYRIAD()+PERMYRIAD_AS_PERCENT_FORMAT_STR, matchingBUS_DEFINE_SET_CGROUP_LIMIT.Fixes #41009
(Note: This PR was developed with AI assistance (Claude Code).)