RFR: 8283199: Linux os::cpu_microcode_revision() stalls cold startup [v2]

Aleksey Shipilev shade at openjdk.java.net
Mon Mar 21 10:25:35 UTC 2022


On Mon, 21 Mar 2022 10:12:50 GMT, Claes Redestad <redestad at openjdk.org> wrote:

>> Aleksey Shipilev 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 four additional commits since the last revision:
>> 
>>  - Reflow a bit
>>  - Merge branch 'master' into JDK-8283199-cpu-microcode-revision
>>  - Add comment
>>  - Fix
>
> src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp line 484:
> 
>> 482:   // Attempt 2 (slower): Read the microcode version off the procfs.
>> 483:   {
>> 484:     FILE *fp = os::fopen("/proc/cpuinfo", "r");
> 
> Should this now slow-path continue to use a 2048 element buffer?

No, because AFAICS, `fgets` reads until buffer is full or the EOL is read. We are looking for a rather short "microcode: 0x..." line in procfs, so there is no need to allocate the entire 2K for this. This was my first attempt to improve this code, and it is not directly relevant to issue at hand, so I can revert it, if that's a questionable change.

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

PR: https://git.openjdk.java.net/jdk/pull/7825


More information about the hotspot-runtime-dev mailing list