Mitigation of performance loss for Intel CPUs due JCC Erratum changes in microcode
Andriy Plokhotnyuk
plokhotnyuk at gmail.com
Mon Feb 17 11:42:05 UTC 2020
Hi, All!
Since 13 Nov 2019, new microcodes for Intel CPUs include a fix for the Jump
Conditional Code (JCC) Erratum which carries a significant performance
penalty:
https://www.intel.com/content/dam/support/us/en/documents/processors/mitigations-jump-conditional-code-erratum.pdf
https://www.intel.com/content/dam/www/public/us/en/documents/corporate-information/SA00270-microcode-update-guidance.pdf
On the latest version of microcode slow and inefficient code is almost not
affected, while for highly optimized with a lot of branching in hot loops
throughput slowdown is up to 30% compared to results on the previous
version of microcode. Please see comparison of benchmarks results below.
OpenJDK 8:
https://jmh.morethan.io/?sources=https://raw.githubusercontent.com/plokhotnyuk/jsoniter-scala/1df65ad1df664f74e5c4cc1f32bf57e32ca025ae/openjdk8.json,https://raw.githubusercontent.com/plokhotnyuk/jsoniter-scala/e1b61601ff17a3dc28b7f547b2ec9dff9ad14366/openjdk8.json
OpenJDK 11:
https://jmh.morethan.io/?sources=https://raw.githubusercontent.com/plokhotnyuk/jsoniter-scala/1df65ad1df664f74e5c4cc1f32bf57e32ca025ae/openjdk11.json,https://raw.githubusercontent.com/plokhotnyuk/jsoniter-scala/e1b61601ff17a3dc28b7f547b2ec9dff9ad14366/openjdk11.json
OpenJDK 13:
https://jmh.morethan.io/?sources=https://raw.githubusercontent.com/plokhotnyuk/jsoniter-scala/1df65ad1df664f74e5c4cc1f32bf57e32ca025ae/openjdk13.json,https://raw.githubusercontent.com/plokhotnyuk/jsoniter-scala/e1b61601ff17a3dc28b7f547b2ec9dff9ad14366/openjdk13.json
Moreover, currently it is quite hard get stable results with OpenJDK
because they depends on alignment of branches and jumps in the compiled
code.
My question is: would be the HotSpot Dev team interested in mitigation of
the issue in the Hotspot C2 compiler?
I found a bug report for the issue, but it is scoped for ZGC only:
https://bugs.openjdk.java.net/browse/JDK-8234160
BTW, the same kind of issue was successfully mitigated by the GraalVM team:
https://github.com/oracle/graal/issues/1829
Best regards,
Andriy.
More information about the hotspot-compiler-dev
mailing list