RFR 8250984: Memory Docker tests fail on some Linux kernels w/o swap limit capabilities

Harold Seigel harold.seigel at oracle.com
Tue Sep 1 19:43:58 UTC 2020


Hi Bob,

Thanks for looking at this!

I'll investigate the problem some more based on your suggestions.

Harold

On 9/1/2020 12:04 PM, Bob Vandette wrote:
> I really dislike encoding all these strings in our tests that could possibly change.
>
> I wish we did something like check for the existence of /sys/fs/cgroup/memory/memsw.limit_in_bytes
> assuming that this file is not present when swap limiting is disabled.  The problem with this approach
> and yours is that we need to make that these fixes we can run on docker, podman, cgroupv1 and cgroupv2.
>
> Others are struggling with these types of issues …
>
> https://github.com/containers/podman/issues/6365
>
> The Metrics API I added provides for the possibility that the call to getMemoryAndSwapLimit
> could fail.  Perhaps the test should be checking for not supported and fix the API implementation
> to report the correct error (if it doesn’t already).
>
>      /**
>       * Returns the maximum amount of physical memory and swap space,
>       * in bytes, that can be allocated in the Isolation Group.
>       *
>       * @return The maximum amount of memory in bytes or -1 if
>       *         there is no limit set or -2 if this metric is not supported.
>       *
>       */
>      public long getMemoryAndSwapLimit();
>
> My .02$
>
> Bob.
>
>> On Sep 1, 2020, at 11:31 AM, Harold Seigel <harold.seigel at oracle.com> wrote:
>>
>> Hi,
>>
>> Please review this fix to enable docker tests TestMemoryAwareness.java and TestDockerMemoryMetrics.java to run on Linux kernels configured without swap limit capabilities.
>>
>> Open Webrev: http://cr.openjdk.java.net/~hseigel/bug_8250984.dkr/webrev/index.html
>>
>> JBS Bug: https://bugs.openjdk.java.net/browse/JDK-8250984
>>
>> The modified tests were run on Linux kernels with and without swap limit capabilities.
>>
>> Thanks, Harold
>>


More information about the hotspot-runtime-dev mailing list