RFR: 8362564: hotspot/jtreg/compiler/c2/TestLWLockingCodeGen.java fails on static JDK on x86_64 with AVX instruction extensions [v2]

Jiangli Zhou jiangli at openjdk.org
Tue Jul 29 23:00:03 UTC 2025


On Tue, 29 Jul 2025 22:14:11 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:

>>> @vnkozlov Do you refer to the PR testing? It's https://github.com/openjdk/jdk/pull/26395/checks, thanks.
>> 
>> Yes, that. I did not realize that GitHub removes it from main PR tab after integration.
>> 
>> Good, it was tested.  I think GitHub actions use AVX512 machines.  But I remember that static build testing was excluded.
>> 
>> First, I am fine with fix you pushed. But it is strange.
>> 
>> There should be no difference in stubs sizes running with regular JDK on avx512 machine and static JDK. I don't see how we don't trigger this issue in our testing - we regularly running on AVX512 machines.
>> 
>> Do you have additional code somewhere in macro assembler for static build? Is it possible to compare assembler code?
>> I see you posted sizes in bug report. Can you compare code for `StubRoutines::forward_exception()` which has smallest size to see what is difference.
>
>> Can you compare code for StubRoutines::forward_exception() which has smallest size to see what is difference.
> 
> Please run both, regular and static JDK, on AVX512 machine.

Thanks for clarification @vnkozlov. 

> First, I am fine with fix you pushed. But it is strange.
> 
> There should be no difference in stubs sizes running with regular JDK on avx512 machine and static JDK. I don't see how we don't trigger this issue in our testing - we regularly running on AVX512 machines.

I was wondering the same initially, for regular JDK vs static JDK. So I did some measurements and confirmed the difference. Here is the data from the tests that I ran on machines with AVX extensions. I haven't looked into details of the generated instructions to see which ones are related, though.

static JDK

StubRoutines::forward_exception [0x00007f2b2e000ee0, 0x00007f2b2e001031] (337 bytes)

StubRoutines::call_stub [0x00007f2b2e001031, 0x00007f2b2e00142a] (1017 bytes)

StubRoutines::catch_exception [0x00007f2b2e00142a, 0x00007f2b2e00161d] (499 bytes)

StubRoutines::updateBytesCRC32 [0x00007f2b2e0017e0, 0x00007f2b2e001c8e] (1198 bytes)

StubRoutines::updateBytesCRC32C [0x00007f2b2e001ca0, 0x00007f2b2e0023b4] (1812 bytes)

StubRoutines::dsin [0x00007f2b2e0023cc, 0x00007f2b2e002b11] (1861 bytes)

StubRoutines::dtan [0x00007f2b2e003212, 0x00007f2b2e003b1a] (2312 bytes)

StubRoutines::dtanh [0x00007f2b2e003b1a, 0x00007f2b2e003e75] (859 bytes)

StubRoutines::dcbrt [0x00007f2b2e003e75, 0x00007f2b2e0040ea] (629 bytes)

StubRoutines::dexp [0x00007f2b2e0040ea, 0x00007f2b2e004477] (909 bytes)

StubRoutines::dpow [0x00007f2b2e004477, 0x00007f2b2e005652] (4571 bytes)

StubRoutines::dlog [0x00007f2b2e005652, 0x00007f2b2e0058e6] (660 bytes)

StubRoutines::dlog10 [0x00007f2b2e0058e6, 0x00007f2b2e005bce] (744 bytes)

StubRoutines::fmod [0x00007f2b2e005be0, 0x00007f2b2e005de7] (519 bytes)

[0.009s][info][stubs] StubRoutines (initialstubs) [0x00007f2b2e000ee0, 0x00007f2b2e006228] used: 20231, free: 1089;


regular JDK

StubRoutines::forward_exception [0x00007f018e000ee0, 0x00007f018e001015] (309 bytes)

StubRoutines::call_stub [0x00007f018e001015, 0x00007f018e0013c8] (947 bytes)

StubRoutines::catch_exception [0x00007f018e0013c8, 0x00007f018e001598] (464 bytes)

StubRoutines::updateBytesCRC32 [0x00007f018e001760, 0x00007f018e001bf9] (1177 bytes)

StubRoutines::updateBytesCRC32C [0x00007f018e001c00, 0x00007f018e002304] (1796 bytes)

StubRoutines::dsin [0x00007f018e00231c, 0x00007f018e0029ab] (1679 bytes)

StubRoutines::dcos [0x00007f018e0029ab, 0x00007f018e00301c] (1649 bytes)

StubRoutines::dtan [0x00007f018e00301c, 0x00007f018e003864] (2120 bytes)

StubRoutines::dtanh [0x00007f018e003864, 0x00007f018e003b48] (740 bytes)

StubRoutines::dcbrt [0x00007f018e003b48, 0x00007f018e003d5b] (531 bytes)

StubRoutines::dexp [0x00007f018e003d5b, 0x00007f018e004078] (797 bytes)

StubRoutines::dpow [0x00007f018e004078, 0x00007f018e005161] (4329 bytes)

StubRoutines::dlog [0x00007f018e005161, 0x00007f018e0053d2] (625 bytes)

StubRoutines::dlog10 [0x00007f018e0053d2, 0x00007f018e00567b] (681 bytes)

StubRoutines::fmod [0x00007f018e005680, 0x00007f018e005867] (487 bytes)

[0.005s][info][stubs] StubRoutines (initialstubs) [0x00007f018e000ee0, 0x00007f018e006228] used: 18823, free: 2497; code_size: 21000

>
> Do you have additional code somewhere in macro assembler for static build? Is it possible to compare assembler code? I see you posted sizes in bug report. Can you compare code for StubRoutines::forward_exception() which has smallest size to see what is difference.

> Please run both, regular and static JDK, on AVX512 machine.

There was not static specific in macro assembler. Let me try running the tests again and update ...

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

PR Comment: https://git.openjdk.org/jdk/pull/26395#issuecomment-3134308400


More information about the hotspot-dev mailing list