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

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


On Fri, 24 Oct 2025 09:50:33 GMT, Thomas Stuefe <stuefe 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/cgroupSubsystem_linux.cpp line 638:
> 
>> 636: bool CgroupSubsystem::active_processor_count(int& value) {
>> 637:   int cpu_count;
>> 638:   int result = -1;
> 
> Why not get rid of result and use `value` throughout like you did in the cached case?

It's useful to do assertions on the value retrieved by `CgroupUtil::processor_count()` before the actual result is being changed. Using `value` has the issue of not knowing what the reference default value was set to.

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

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


More information about the hotspot-jfr-dev mailing list