<div id="mailbox-conversation"><div style="font-family:微软雅黑;font-size:14px;color:#000000"><div>Hi,</div><div><span style="font-family: monospace, serif; font-size: 1em; orphans: 2; white-space: pre-wrap; widows: 2; line-height: 1.6;">JDK-8180450(</span><a href="https://bugs.openjdk.org/browse/JDK-8180450" style="font-family: monospace, serif; font-size: 1em; orphans: 2; white-space: pre-wrap; widows: 2; line-height: 1.6;">https://bugs.openjdk.org/browse/JDK-8180450</a><span style="font-family: monospace, serif; font-size: 1em; orphans: 2; white-space: pre-wrap; widows: 2; line-height: 1.6;">) has a mojor performance impact on concurrent Java applications. Thanks to Andrew Haley to get it fixed in OpenJDK 23.</span><br></div><div><pre style="white-space: pre-wrap; color: rgb(0, 0, 0); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">However, some applications suffered from this issue have to stay in the older OpenJDK version. For example, Spark requires OpenJDK11, but suffers the secondary supertype cache problem as well(<a href="https://github.com/scala/bug/issues/9823">https://github.com/scala/bug/issues/9823</a>). </pre><pre style="white-space: pre-wrap; color: rgb(0, 0, 0); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">I have run a snall test on query29 of TPC-DS on Spark 3.5.1, JDK11 with Francesco Nigro's fantastic agent tool(https://github.com/RedHatPerf/type-pollution-agent) to check how Spark is affected by the issue. The report shows there are around 2.4M secondary super cache invalidations in 108 seconds.It suggests the Spark is severely affected.</pre><pre style="white-space: pre-wrap; color: rgb(0, 0, 0); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">I modified the JDK11 a little bit by removing the updating of Klass::_secondary_super_cache:</pre><pre style="white-space: pre-wrap; color: rgb(0, 0, 0); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">diff --git a/src/hotspot/cpu/x86/macroAssembler_x86.cpp b/src/hotspot/cpu/x86/macroAssembler_x86.cpp<br>index 721134f84e..36f2146438 100644<br>--- a/src/hotspot/cpu/x86/macroAssembler_x86.cpp<br>+++ b/src/hotspot/cpu/x86/macroAssembler_x86.cpp<br>@@ -5044,7 +5044,7 @@ void MacroAssembler::check_klass_subtype_slow_path(Register sub_klass,<br> else jcc(Assembler::notEqual, *L_failure);<br><br> // Success. Cache the super we found and proceed in triumph.<br>- movptr(super_cache_addr, super_klass);<br>+ // movptr(super_cache_addr, super_klass);<br><br> if (L_success != &L_fallthrough) {<br> jmp(*L_success);<br></pre><pre style="white-space: pre-wrap; color: rgb(0, 0, 0); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><br></pre><pre style="white-space: pre-wrap; color: rgb(0, 0, 0); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">And the performance of query29 get improved by 2% (average of 5 times' testing) instantly. </pre><pre style="white-space: pre-wrap; color: rgb(0, 0, 0); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">It seems <span style="color: rgb(0, 0, 0); font-family: monospace, serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 22.4px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none;">Spark and other concurrent applications will gain significant performance improvement from the fix. </span><span style="font-size: 1em; line-height: 1.6;">Is there a plan to backport the fix to JDK 11 in the future?</span></pre><pre style="white-space: pre-wrap; color: rgb(0, 0, 0); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><span style="font-size: 1em; line-height: 1.6;"><br></span></pre>
</div><div><div id="mailbox-conversation">
<pre class=" __aliyun_node_has_color" style="color: #000000;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0.0px;text-transform: none;widows: 2;word-spacing: 0.0px;">Ziyi Lin<br></pre><pre class=" __aliyun_node_has_color" style="color: #000000;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: left;text-indent: 0.0px;text-transform: none;widows: 2;word-spacing: 0.0px;">cengfeng.lzy@alibaba-inc.com</pre>
</div></div></div></div>