RFR: 8366847: JFR reports incorrect number of cores on hybrid CPU [v3]
Yasumasa Suenaga
ysuenaga at openjdk.org
Fri Oct 3 12:59:50 UTC 2025
On Fri, 3 Oct 2025 06:55:56 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> Yasumasa Suenaga 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 jfr-on-hy-cpu
>> - Use jmc_undefined_long if runs on hybrid CPU
>> - Revert "Update condition"
>>
>> This reverts commit ebf4aec23fa95c8d54d1196c7be85e99f0846420.
>> - Update condition
>> - Add fallback code if logical_cpus == 0
>> - 8365633: JFR reports incorrect number of cores on hybrid CPU
>
> src/hotspot/cpu/x86/vm_version_x86.cpp line 2595:
>
>> 2593: // estimate the number of cores.
>> 2594: // -1 if hybrid CPU because it is difficult to derive number of cores.
>> 2595: _no_of_cores = supports_hybrid() ? -1 : (cores_per_cpu() * _no_of_sockets);
>
> It is only meant to be an estimate and -1 is not an estimate at all it is a "I don't know" answer. But why do we not know - using my earlier example won't number of cores be 8 as expected 6P+2E? Even if not it would yield a better approximation than -1.
I think incorrect value is not useful because it causes confusing.
If we have to keep current code to set estimated value, I can use `VM_Version::supports_hybrid()` in JFR code to emit -1 on the event.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27080#discussion_r2401819924
More information about the hotspot-dev
mailing list