RFR: 8356868: Not all cgroup parameters are made available
Casper Norrbin
cnorrbin at openjdk.org
Thu May 22 09:11:05 UTC 2025
Hi everyone,
This PR improves cgroup support by exposing additional parameters that are currently not available. These parameters would enable more advanced features that rely on CPU and memory usage data.
The new parameters are:
- CPU usage: `cpuacct.usage` (cgroup v1) and `cpu.stat` (cgroup v2), which allow precise tracking of consumed CPU time.
- Peak memory usage: `memory.peak` (cgroup v2). While the cgroup v1 equivalent (`memory.max_usage_in_bytes`) was already available, cgroup v2 previously returned `OSCONTAINER_ERROR` — this has now been fixed.
- Memory throttle limit: `memory.high` (cgroup v2). There is no direct equivalent in cgroup v1, but since most systems use cgroup v2, exposing this parameter enables finer-grained memory control for those systems.
Testing:
- All container tests under `/test/hotspot/jtreg/containers/`
- Manually inspected the new parameters in both cgroup v1 and v2 container environments with the relevant settings applied.
-------------
Commit messages:
- added cgroup parameters
Changes: https://git.openjdk.org/jdk/pull/25388/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25388&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8356868
Stats: 163 lines in 10 files changed: 148 ins; 0 del; 15 mod
Patch: https://git.openjdk.org/jdk/pull/25388.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/25388/head:pull/25388
PR: https://git.openjdk.org/jdk/pull/25388
More information about the hotspot-runtime-dev
mailing list