[jdk11u-dev] RFR: 8230305: Cgroups v2: Container awareness
Severin Gehwolf
sgehwolf at openjdk.java.net
Mon Mar 14 17:03:46 UTC 2022
On Fri, 11 Mar 2022 15:49:08 GMT, Jonathan Dowland <jdowland at openjdk.org> wrote:
> For me, `PlainRead.java` is failing on a pure cgroups v2 system (passes on v1):
>
> ```
> ;$JT_HOME/bin/jtreg -jdk:build/linux-x86_64-normal-server-release/jdk test/hotspot/jtreg/containers/cgroup/PlainRead.java
> Test results: failed: 1
> ```
>
> (I noticed this in a downstream backport and traced it back up here)
>
> I've put my JTreport here: https://jmtd.net/tmp/jdk11u_8230305_PlainRead_jtreport/JTreport/html/index.html
>
> Edit: @jerboaa [points out](https://github.com/openjdk/jdk11u-dev/pull/881#issuecomment-1065226806) that this is probably JDK-8278951, although backporting that does not fix the test for me locally. I'll keep exploring.
>
> Edit 2: fails for me on jdk17u-dev master, passes on jdk master.
Note that the `PlainRead.java` test depends on proper [setup of the `cpu` controller](https://www.scrivano.org/2019/02/26/resources-management-with-rootless-containers/) on your cgroups v2 system (unlike cgroups v1). It passes for me on my configured cgroups v2 system:
# /home/sgehwolf/jdk11u-dev/../jdk11u-jdk/bin/java -cp /home/sgehwolf/jdk11u-dev/JTwork/classes/containers/cgroup/PlainRead.d:/home/sgehwolf/jdk11u-dev/test/hotspot/jtreg/containers/cgroup:/home/sgehwolf/jdk11u-dev/JTwork/classes/testlibrary:/home/sgehwolf/jdk11u-dev/test/hotspot/jtreg/testlibrary:/home/sgehwolf/jdk11u-dev/JTwork/classes/test/lib:/home/sgehwolf/jdk11u-dev/test/lib:/home/sgehwolf/jtreg-5/lib/javatest.jar:/home/sgehwolf/jtreg-5/lib/jtreg.jar -Xlog:os+container=trace -version
[0.001s][trace][os,container] OSContainer::init: Initializing Container Support
[0.001s][debug][os,container] Detected cgroups v2 unified hierarchy
[0.001s][trace][os,container] Path to /memory.max is /sys/fs/cgroup/user.slice/user-1000.slice/session-2.scope/memory.max
[0.001s][trace][os,container] Raw value for memory limit is: max
[0.001s][trace][os,container] Memory Limit is: Unlimited
[0.002s][trace][os,container] Path to /cpu.max is /sys/fs/cgroup/user.slice/user-1000.slice/session-2.scope/cpu.max
[0.002s][trace][os,container] Raw value for CPU quota is: max
[0.002s][trace][os,container] CPU Quota is: -1
[0.002s][trace][os,container] Path to /cpu.max is /sys/fs/cgroup/user.slice/user-1000.slice/session-2.scope/cpu.max
[0.002s][trace][os,container] CPU Period is: 100000
[0.002s][trace][os,container] Path to /cpu.weight is /sys/fs/cgroup/user.slice/user-1000.slice/session-2.scope/cpu.weight
[0.002s][trace][os,container] Raw value for CPU shares is: 100
[0.002s][debug][os,container] CPU Shares is: -1
[0.002s][trace][os,container] OSContainer::active_processor_count: 4
[0.002s][trace][os,container] CgroupSubsystem::active_processor_count (cached): 4
[0.002s][debug][os,container] container memory limit unlimited: -1, using host value
[0.002s][debug][os,container] container memory limit unlimited: -1, using host value
[0.003s][trace][os,container] CgroupSubsystem::active_processor_count (cached): 4
[0.072s][trace][os,container] Path to /cpu.max is /sys/fs/cgroup/user.slice/user-1000.slice/session-2.scope/cpu.max
[0.072s][trace][os,container] Raw value for CPU quota is: max
[0.072s][trace][os,container] CPU Quota is: -1
[0.072s][trace][os,container] Path to /cpu.max is /sys/fs/cgroup/user.slice/user-1000.slice/session-2.scope/cpu.max
[0.072s][trace][os,container] CPU Period is: 100000
[0.072s][trace][os,container] Path to /cpu.weight is /sys/fs/cgroup/user.slice/user-1000.slice/session-2.scope/cpu.weight
[0.072s][trace][os,container] Raw value for CPU shares is: 100
[0.072s][debug][os,container] CPU Shares is: -1
[0.072s][trace][os,container] OSContainer::active_processor_count: 4
[0.095s][trace][os,container] Path to /memory.max is /sys/fs/cgroup/user.slice/user-1000.slice/session-2.scope/memory.max
[0.095s][trace][os,container] Raw value for memory limit is: max
[0.095s][trace][os,container] Memory Limit is: Unlimited
[0.095s][debug][os,container] container memory limit unlimited: -1, using host value
[0.095s][debug][os,container] container memory limit unlimited: -1, using host value
[0.096s][debug][os,container] container memory limit unlimited: -1, using host value
[0.096s][debug][os,container] container memory limit unlimited: -1, using host value
[0.097s][debug][os,container] container memory limit unlimited: -1, using host value
[0.097s][debug][os,container] container memory limit unlimited: -1, using host value
[0.098s][debug][os,container] container memory limit unlimited: -1, using host value
[0.098s][debug][os,container] container memory limit unlimited: -1, using host value
[0.100s][debug][os,container] container memory limit unlimited: -1, using host value
[0.100s][debug][os,container] container memory limit unlimited: -1, using host value
[0.101s][debug][os,container] container memory limit unlimited: -1, using host value
[0.103s][debug][os,container] container memory limit unlimited: -1, using host value
[0.104s][debug][os,container] container memory limit unlimited: -1, using host value
[0.104s][debug][os,container] container memory limit unlimited: -1, using host value
[0.104s][debug][os,container] container memory limit unlimited: -1, using host value
[0.105s][debug][os,container] container memory limit unlimited: -1, using host value
[0.105s][debug][os,container] container memory limit unlimited: -1, using host value
[0.106s][debug][os,container] container memory limit unlimited: -1, using host value
[0.107s][debug][os,container] container memory limit unlimited: -1, using host value
[0.108s][debug][os,container] container memory limit unlimited: -1, using host value
[0.108s][debug][os,container] container memory limit unlimited: -1, using host value
[0.108s][debug][os,container] container memory limit unlimited: -1, using host value
[0.109s][debug][os,container] container memory limit unlimited: -1, using host value
[0.114s][debug][os,container] container memory limit unlimited: -1, using host value
[0.115s][debug][os,container] container memory limit unlimited: -1, using host value
[0.118s][trace][os,container] Path to /memory.max is /sys/fs/cgroup/user.slice/user-1000.slice/session-2.scope/memory.max
[0.118s][trace][os,container] Raw value for memory limit is: max
[0.118s][trace][os,container] Memory Limit is: Unlimited
[0.118s][debug][os,container] container memory limit unlimited: -1, using host value
[0.120s][debug][os,container] container memory limit unlimited: -1, using host value
[0.121s][debug][os,container] container memory limit unlimited: -1, using host value
[0.121s][debug][os,container] container memory limit unlimited: -1, using host value
[0.122s][debug][os,container] container memory limit unlimited: -1, using host value
[0.123s][debug][os,container] container memory limit unlimited: -1, using host value
[0.123s][debug][os,container] container memory limit unlimited: -1, using host value
[0.124s][debug][os,container] container memory limit unlimited: -1, using host value
[0.125s][debug][os,container] container memory limit unlimited: -1, using host value
[0.131s][debug][os,container] container memory limit unlimited: -1, using host value
[0.132s][debug][os,container] container memory limit unlimited: -1, using host value
[0.135s][debug][os,container] container memory limit unlimited: -1, using host value
[0.137s][debug][os,container] container memory limit unlimited: -1, using host value
[0.137s][debug][os,container] container memory limit unlimited: -1, using host value
[0.138s][trace][os,container] Path to /memory.max is /sys/fs/cgroup/user.slice/user-1000.slice/session-2.scope/memory.max
[0.138s][trace][os,container] Raw value for memory limit is: max
[0.138s][trace][os,container] Memory Limit is: Unlimited
[0.138s][debug][os,container] container memory limit unlimited: -1, using host value
[0.138s][debug][os,container] container memory limit unlimited: -1, using host value
openjdk version "11.0.15-internal" 2022-04-19
OpenJDK Runtime Environment (fastdebug build 11.0.15-internal+0-adhoc.sgehwolf.jdk11u-dev)
OpenJDK 64-Bit Server VM (fastdebug build 11.0.15-internal+0-adhoc.sgehwolf.jdk11u-dev, mixed mode)
[0.142s][debug][os,container] container memory limit unlimited: -1, using host value
[0.142s][debug][os,container] container memory limit unlimited: -1, using host value
This shouldn't block this backport.
-------------
PR: https://git.openjdk.java.net/jdk11u-dev/pull/840
More information about the jdk-updates-dev
mailing list