RFR: JDK-8301661: Enhance os::pd_print_cpu_info on macOS and Windows [v3]

David Holmes dholmes at openjdk.org
Wed Feb 8 20:49:47 UTC 2023


On Wed, 8 Feb 2023 14:56:14 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:

>> Enhance os::pd_print_cpu_info on macOS and Windows by information about CPU frequency and caches.
>> On Windows , this info can be obtained by the Processor Power Information API or "powerbase" (CallNtPowerInformation , see https://learn.microsoft.com/en-us/windows/win32/api/powerbase/nf-powerbase-callntpowerinformation ); this is available since Windows Server 2003/XP.
>> On macOS, sysctlbyname can be used.
>
> Matthias Baesken has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Reuse processor count if possible, adjust output a bit

With regards to the pragma I had the following response from @magicus :
> Oh, please don't do that. We could perhaps have gone down that route, but we didn't. If you do that, there won't be a single source of truth on where to look for library linkage. We had a bug a year or two ago that ended up in us loading a library which nobody expected or realized due to a windows pragma. So, basically, there's nothing inherently wrong with this (just a bit non-standard from an old-school unix point of view), but it does not fit with the current model of the JDK

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

PR: https://git.openjdk.org/jdk/pull/12403


More information about the hotspot-runtime-dev mailing list