JDK-8279176 : Container TestMemoryAwareness fails: cannot set memory swappiness with cgroupv2
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 18
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: linux
  • Submitted: 2021-12-22
  • Updated: 2022-07-15
  • Resolved: 2022-07-15
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdResolved
Related Reports
Duplicate :  
Description
Test: test/hotspot/jtreg/containers/docker/TestMemoryAwareness.java
OS: Oracle Linux 8.4 (x64, aarch64) with cgroups v2
Reproducible: 100%

------------- snipped of test log:
========== NEW TEST CASE:      OOM
sizeToAllocInMb is:266 sizeToAllocInMb/2 is:133
[COMMAND]
podman run --tty=true --rm --volume /home/opc/atr/test-workdir/JTwork/classes/containers/docker/TestMemoryAwareness.d:/test-classes/ --memory 256m --memory-swappiness 0 --memory-swap 256m jdk-internal:test-memory /jdk/bin/java -Xlog:os+container=trace -cp /test-classes/ -Djdk.test.docker.image.name=jpg-data.us.oracle.com:9002/mach5/jdk-test/oraclelinux_8.4_aarch64 -Djdk.test.docker.image.version=1.0 -Djdk.test.container.command=podman -Xmx133m AttemptOOM 266 
[2021-12-20T19:58:18.369484310Z] Gathering output for process 20406
[ELAPSED: 1 ms]
[STDERR]
Error: OCI runtime error: cannot set memory swappiness with cgroupv2


Comments
This is a duplicate of JDK-8289695. Marking as such.
15-07-2022

I'm not sure if the test actually needs '--memory-swappiness 0' for it to work. '--memory 256m' and '--memory-swap 256m' basically says don't allow swap.
22-12-2021

ILW = MMM = P3
22-12-2021

This is likely a test bug. If cgroups v2 does not support swappiness then we should add appropriate check in the test and throw a jtreg.SkippedException with appropriate message, or even better skip the unsupported testcase completely while reporting the skip reason in the test log.
22-12-2021