RFR: 8366847: JFR reports incorrect number of cores on hybrid CPU [v3]

Erik Gahlin egahlin at openjdk.org
Fri Oct 3 13:17:58 UTC 2025


On Fri, 3 Oct 2025 12:56:59 GMT, Yasumasa Suenaga <ysuenaga at openjdk.org> wrote:

>> 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.

Even if the value is incorrect, it still has some value as an approximation. We could update the description to make this clearer, or perhaps provide additional information to help users.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27080#discussion_r2401874712


More information about the hotspot-dev mailing list