RFR: JDK-8281274: deal with ActiveProcessorCount in os::Linux::print_container_info

Severin Gehwolf sgehwolf at openjdk.java.net
Fri Feb 4 17:59:10 UTC 2022


On Fri, 4 Feb 2022 16:18:38 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:

> The function os::Linux::print_container_info outputs memory- and cpu-related container information (when running in a containerized environment).
> However in the case of active processor count , it currently just outputs the info from OSContainer::active_processor_count without  looking at  ActiveProcessorCount that can be set to overwrite the OSContainer::active_processor_count() - information. This should be improved.

Marked as reviewed by sgehwolf (Reviewer).

Hmm, not sure why it recorded my comment as "approval".

src/hotspot/os/linux/os_linux.cpp line 2178:

> 2176:   if (i > 0) {
> 2177:     if (ActiveProcessorCount > 0) {
> 2178:       st->print_cr("%d, but overwritten by flag ActiveProcessorCount: %d",

This will print the same number (processor count) twice. I'd suggest to only add a blurb like `" overridden by -XX:ActiveProcessorCount"` in case the flag is set and not print the blurb otherwise.

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

PR: https://git.openjdk.java.net/jdk/pull/7354Changes requested by sgehwolf (Reviewer).


More information about the hotspot-runtime-dev mailing list