RFR: 8366847: JFR reports incorrect number of cores on hybrid CPU [v5]
Yasumasa Suenaga
ysuenaga at openjdk.org
Wed Oct 8 00:13:42 UTC 2025
On Tue, 7 Oct 2025 18:56:11 GMT, Daniel D. Daugherty <dcubed at openjdk.org> wrote:
>> Oh that is awful - I did not realize that, I assumed we got some kind of bit vector we could query.
>>
>> I'm less concerned about them adding HT to E-cores in the future as we will likely have to expand the code to deal with specific chips anyway.
>>
>> So where does this leave us?
>> - `cores_per_cpu` is an approximation
>> - anything reporting the `cores_per_cpu` value needs to include some text (if it is a hybrid) to indicate it is an approximation
>
> Based on the comments that I'm reading in this PR, it seems like the existing logic
> presumes Symmetric Multi-Processing (SMP) instead of Asymmetric Multi-Processing
> (AMP) or is the AMP support in a different place in the code.
>
> A very long time ago, Solaris SPARC servers could be provisioned with differing processors
> with different core counts and speed ratings. I don't know if we supported those AMP
> servers in Java or not, but there was definitely support in Solaris itself.
I updated this PR to revert data type change to `uint`, so number of cores might be incorrect on hybrid CPU. "cores" in `jdk.CPUInformation` event would be set "approximated" value, but "Hybrid Architecture" would be added into "description" field in that case.
I grep'ed to find user of `cores_per_cpu`, this value would be used in JFR and reporting only like I've fixed in #26808 , thus this change affects limited area only AFAICS.
> Based on the comments that I'm reading in this PR, it seems like the existing logic
presumes Symmetric Multi-Processing (SMP) instead of Asymmetric Multi-Processing
(AMP) or is the AMP support in a different place in the code.
Has Intel released AMP processor for Xeon / Core line? If AMP is SPARC only in context of Java, it would be implemented on SPARC-specific code, but it has already gone...
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27080#discussion_r2412215707
More information about the hotspot-dev
mailing list