RFR: 8327946: containers/docker/TestJFREvents.java fails when host kernel config vm.swappiness=0 after JDK-8325139 [v2]
Severin Gehwolf
sgehwolf at openjdk.org
Thu Apr 11 15:52:45 UTC 2024
On Thu, 11 Apr 2024 15:36:31 GMT, SendaoYan <syan at openjdk.org> wrote:
>> test/hotspot/jtreg/containers/docker/TestJFREvents.java line 225:
>>
>>> 223: .addDockerOpts("--memory-swap=" + swapValueToSet)
>>> 224: //The default memory-swappiness vaule is inherited from the host machine, which maybe 0
>>> 225: .addDockerOpts("--memory-swappiness=60")
>>
>> Nit: Space after `//`.
>>
>> `--memory-swappiness` is cgroup v1 (legacy specific):
>>
>> $ podman run --rm -ti --memory-swappiness=60 fedora:39
>> Error: OCI runtime error: crun: cannot set memory swappiness with cgroupv2
>>
>>
>> Therefore, we need to ensure we are running on cgroups v1 when we add that option.
>
> Thanks for your review. The space after `//` has been added.
>
> I can't reproduce the "OCI runtime error" failure on mine ubuntu22 environment.
> It seems that ubuntu22 use cgroups v2 by default.
> 
>
> Can you show your host machine enviroment information, so I can reproduce the same failure. After that I will try to find a solution with cgroupv2.
It seems to be podman runtime specific. `crun` fails, `runc` doesn't seem to be. Either way, the corresponding interface file, `memory.swappiness` doesn't exist for cgroup v2. Try `podman run --runtime /usr/bin/crun --rm -ti --memory-swappiness=60 fedora:39` provided the `crun` runtime is installed in `/usr/bin`.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18225#discussion_r1561254854
More information about the hotspot-dev
mailing list