RFR: 8366847: JFR reports incorrect number of cores on hybrid CPU [v3]
David Holmes
dholmes at openjdk.org
Tue Oct 7 04:46:47 UTC 2025
On Tue, 7 Oct 2025 02:32:08 GMT, Yasumasa Suenaga <ysuenaga at openjdk.org> wrote:
>> Sorry I am very confused as to what is being calculated by what. IIUC (big IF!) we will always calculate `cores_per_cpu` incorrectly because we will assume all cores have the same HT setting - hence when we divide total-threads-per-cpu by threads-per-core, to get cores-per-cpu, the answer may be incorrect.
>
> Agree! HT flag is set even though it is E-core (do not have HT), and also we cannot get number of physical cores, hence cores-per-cpu is always incorrect as you said.
Can we not check for "Intel Hybrid Information" CPUID leaf (0x1A) that reports the type of each core and use that to get an accurate core count? So that:
int cores_per_cpu() {
if (is_hybrid()) {
if (hyper_threaded() ) {
return _no_of_threads - _no_of_e_cores;
} else {
return _no_of_threads;
}
} else {
return _no_of_threads / threads_per_core();
}
}
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27080#discussion_r2409331900
More information about the hotspot-dev
mailing list