On Mon, 22 Jul 2024 13:48:29 GMT, Severin Gehwolf <sgehw...@openjdk.org> wrote:
>> Jan Kratochvil has refreshed the contents of this pull request, and previous >> commits have been removed. Incremental views are not available. > > test/hotspot/jtreg/containers/cgroup/NestedCgroup.java line 193: > >> 191: } >> 192: } >> 193: private static class TestNoController extends Test { > > This logic doesn't seem to detect `cgv1` and `cgv2` correctly. When I run > this on a cgv1 system (hybrid) then I get a failure that looks like this: > > > ----------System.err:(33/2506)---------- > -------------------------------------------------------------------------------- > command: cgdelete -r -g memory:jdktest150899 > -------------------------------------------------------------------------------- > stdout > -------------------------------------------------------------------------------- > stderr > cgdelete: cannot remove group 'jdktest150899': No such file or directory > -------------------------------------------------------------------------------- > -------------------------------------------------------------------------------- > command: cgcreate -g memory:jdktest150899/inner > -------------------------------------------------------------------------------- > stdout > -------------------------------------------------------------------------------- > stderr > -------------------------------------------------------------------------------- > isCgroup2 = true > -------------------------------------------------------------------------------- > cgroup2 mount point: /sys/fs/cgroup/unified > java.nio.file.NoSuchFileException: > /sys/fs/cgroup/unified/jdktest150899/memory.max > at > java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92) > at > java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106) > at > java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111) > at > java.base/sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:262) > at > java.base/java.nio.file.spi.FileSystemProvider.newOutputStream(FileSystemProvider.java:482) > at java.base/java.nio.file.Files.newOutputStream(Files.java:228) > at java.base/java.nio.file.Files.write(Files.java:3516) > at java.base/java.nio.file.Files.writeString(Files.java:3738) > at java.base/java.nio.file.Files.writeString(Files.java:3678) > at NestedCgroup$Test.<init>(NestedCgroup.java:161) > at NestedCgroup$TestTwoLimits.<init>(NestedCgroup.java:190) > at NestedCgroup.main(NestedCgroup.java:221) > at > java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) > at java.base/java.lang.r... I have used `Metrics.systemMetrics()`. But it still needs to parse `Metrics.systemMetrics()` to find out the mount point (`sysFsCgroup`) to write into the `memory.max` file. I have tried to combine both. Please tell me if it works or not on your system. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/17198#discussion_r1695317939