RFR: 8250984: Memory Docker tests fail on some Linux kernels w/o cgroupv1 …
Harold Seigel
hseigel at openjdk.java.net
Fri Sep 25 14:17:26 UTC 2020
On Fri, 25 Sep 2020 13:06:15 GMT, Severin Gehwolf <sgehwolf at openjdk.org> wrote:
>> Please review this change to fix memory docker tests failures on some Linux kernels w/o cgroupv1 swap limit
>> capabilities. The fix works by detecting that swap limit capabilities are not available and returning non-swap related
>> information. For example, if memory and swap usage is requested, and swap limit capabilities are not available, then
>> only memory usage is returned. The fix was tested by running container tests on systems with and without swap limit
>> capabilities. Additionally, the changes were regression tested by running tier1 and tier2 tests on Windows, Linux x64,
>> and Mac OS, and running tier3 - tier5 tests on Linux x64.
>
> test/hotspot/jtreg/containers/docker/TestMemoryAwareness.java line 167:
>
>> 165: out.shouldContain("OperatingSystemMXBean.getTotalSwapSpaceSize: " + expectedSwap);
>> 166: } catch(RuntimeException ex) {
>> 167: out.shouldMatch("OperatingSystemMXBean.getTotalSwapSpaceSize: -?([0-9]+)");
>
> Is the optional `-` intentional? My understanding is that it should never be negative, should it not?
The optional - is intential in case UNLIMITED is return (-1).
> test/hotspot/jtreg/containers/docker/TestMemoryAwareness.java line 163:
>
>> 161: // or the cgroup is not mounted. Memory limited without swap."
>> 162: // the getTotalSwapSpaceSize does not return the expected result and
>> 163: // getFreeSwapSpaceSize returns 0
>
> https://bugs.openjdk.java.net/browse/JDK-8244500 indicates a system where we have the kernel warning, but
> getFreeSwapSpaceSize() returned the system values. *Not* 0 as indicated in this comment. This yields me to believe
> there are inconsistently behaving systems out there. Could we rephrase this comment?
Thanks for reviewing this!
Does this change to the comment look better?
` // in case of warnings like : "Your kernel does not support swap limit capabilities
// or the cgroup is not mounted. Memory limited without swap."
// the getTotalSwapSpaceSize and getFreeSwapSpaceSize return the system
// values as the container setup isn't supported in that case.
`
-------------
PR: https://git.openjdk.java.net/jdk/pull/342
More information about the hotspot-runtime-dev
mailing list