Critical JNI and (Shenandoah) pinning questions

Florian Weimer fweimer at redhat.com
Fri Aug 23 10:03:52 UTC 2019


* Ioannis Tsakpinis:

> I then did some experiments and was able to identify what has caused
> the higher JNI overhead on Java 10; JDK-8178811 [2] and the VZEROUPPER
> instructions that were added in various places of the JNI wrapper code.
> Running the benchmark with -XX:UseAVX=0 (which effectively disables the
> CPU_VZEROUPPER capability in vm_version_x86.hpp):
>
> Patched JDK
>     Standard JNI: ~7.5ns
>     Critical JNI: ~4.2ns (!)

Why isn't the VZEROUPPER performed after using AVX2 registers?  It's
supposed to cost approximately zero in that context.

Have you tried replacing the VZEROUPPER with a NOP of equal length?
Maybe it's just an instruction alignment issue.

Thanks,
Florian


More information about the shenandoah-dev mailing list