8266490: Extend the OSContainer API to support the pids controller of cgroups

Reviewed-by: sgehwolf, lucy
This commit is contained in:
Matthias Baesken 2021-08-10 07:40:21 +00:00
parent 2384e12888
commit 089e83bf1b
22 changed files with 527 additions and 79 deletions

View file

@ -2238,6 +2238,7 @@ void os::Linux::print_uptime_info(outputStream* st) {
bool os::Linux::print_container_info(outputStream* st) {
if (!OSContainer::is_containerized()) {
st->print_cr("container information not found.");
return false;
}
@ -2326,6 +2327,14 @@ bool os::Linux::print_container_info(outputStream* st) {
st->print_cr("%s", j == OSCONTAINER_ERROR ? "not supported" : "unlimited");
}
j = OSContainer::OSContainer::pids_max();
st->print("maximum number of tasks: ");
if (j > 0) {
st->print_cr(JLONG_FORMAT, j);
} else {
st->print_cr("%s", j == OSCONTAINER_ERROR ? "not supported" : "unlimited");
}
return true;
}