RFR: 8365606: Container code should not be using jlong/julong [v2]

Severin Gehwolf sgehwolf at openjdk.org
Mon Nov 10 15:21:13 UTC 2025


On Wed, 22 Oct 2025 14:09:48 GMT, Casper Norrbin <cnorrbin at openjdk.org> wrote:

>> Severin Gehwolf has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision:
>> 
>>  - Merge branch 'master' into jdk-8365606-jlong-julong-refactor
>>  - Fix print_container_info output
>>  - whitespace clean-ups and other small fixes
>>  - Fix log format in container macro and scanf format
>>  - Fix duplicate include in osContainer_linux
>>  - 8365606: Container code should not be using jlong/julong
>
> src/hotspot/os/linux/os_linux.cpp line 4863:
> 
>> 4861:   if (OSContainer::is_containerized() && OSContainer::active_processor_count(active_cpus)) {
>> 4862:     log_trace(os)("active_processor_count: determined by OSContainer: %d",
>> 4863:                    active_cpus);
> 
> When running containerized, we would now always fetch the os cpu count at least once.
> 
> `CgroupSubsystem::active_processor_count`, which this calls down to has the cache to actively avoid getting the cpu count too frequently, and only gets the number of cpus with `os::Linux::active_processor_count` when the cache expires.
> 
> I don't know if this is still an issue today, but since it's there I still think we should avoid getting the cpus if unnecessary.

Thanks, fixed.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27743#discussion_r2510972683


More information about the hotspot-jfr-dev mailing list