RFR: JDK-8273526: Extend the OSContainer API pids controller with pids.current [v3]

Ioi Lam iklam at openjdk.java.net
Tue Sep 14 16:40:11 UTC 2021


On Tue, 14 Sep 2021 14:27:36 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:

>> https://bugs.openjdk.java.net/browse/JDK-8266490
>> extended the OSContainer API in order to also support the pids controller of cgroups. However only pids.max output was added with 8266490.
>> There is a second parameter pids.current , see https://www.kernel.org/doc/html/latest/admin-guide/cgroup-v2.html#pid
>> that would be helpful too and can be added to the OSContainer API .
>> pids.current :
>> A read-only single value file which exists on all cgroups.
>> The number of processes currently in the cgroup and its descendants.
>> 
>> Best regards, Matthias
>
> Matthias Baesken has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Simplify coding following Severins advice

HotSpot changes look good to me. I have a comment on the test.

test/hotspot/jtreg/containers/docker/TestPids.java line 97:

> 95:                 System.out.println("DEBUG: parts.length = " + parts.length);
> 96:                 if (expectedValue.equals("no_value_expected")) {
> 97:                     Asserts.assertEquals(parts.length, 2);

Is "no_value_expected" generated by Docker? I searched the entire HotSpot source code and couldn't find it. I also couldn't find "WARNING: Your kernel does not support pids limit capabilities". 

To make it easier to understand this test, I would suggest grouping all messages that were generated outside of HotSpot into something like:


// These messages are generated by Docker
static final String warning_kernel_no_pids_support = "WARNING: Your kernel does not support pids limit capabilities";
static final String no_value_expected = "no_value_expected";

-------------

PR: https://git.openjdk.java.net/jdk/pull/5437


More information about the core-libs-dev mailing list