<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Jul 18, 2018, at 3:08 PM, Vladimir Kozlov <<a href="mailto:vladimir.kozlov@oracle.com" class="">vladimir.kozlov@oracle.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><span style="caret-color: rgb(0, 0, 0); font-family: Verdana; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">On 7/18/18 6:15 AM, Christian Thalinger wrote:</span><br style="caret-color: rgb(0, 0, 0); font-family: Verdana; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><blockquote type="cite" style="font-family: Verdana; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><blockquote type="cite" class="">On Jul 18, 2018, at 12:14 AM, Vladimir Kozlov <<a href="mailto:vladimir.kozlov@oracle.com" class="">vladimir.kozlov@oracle.com</a><<a href="mailto:vladimir.kozlov@oracle.com" class="">mailto:vladimir.kozlov@oracle.com</a>>> wrote:<br class=""><br class="">On 7/17/18 5:17 PM, Christian Thalinger wrote:<br class=""><blockquote type="cite" class=""><blockquote type="cite" class="">On Jul 12, 2018, at 5:28 PM, Vladimir Kozlov <<a href="mailto:vladimir.kozlov@oracle.com" class="">vladimir.kozlov@oracle.com</a><<a href="mailto:vladimir.kozlov@oracle.com" class="">mailto:vladimir.kozlov@oracle.com</a>>> wrote:<br class=""><br class="">Including GC group since I added new method to GCConfig.<br class=""><br class=""><a href="http://cr.openjdk.java.net/~kvn/8207069/webrev.00/" class="">http://cr.openjdk.java.net/~kvn/8207069/webrev.00/</a><<a href="http://cr.openjdk.java.net/%7Ekvn/8207069/webrev.00/" class="">http://cr.openjdk.java.net/%7Ekvn/8207069/webrev.00/</a>><br class=""><a href="https://bugs.openjdk.java.net/browse/JDK-8207069" class="">https://bugs.openjdk.java.net/browse/JDK-8207069</a><br class=""><br class="">Recent Graal's changes [1] added list of GC [2] which matches Hotspot GC list [3].<br class="">I used that to fix this issue by storing enum value from Graal in AOT config header and compare it with selected GC when AOT library is loaded into Hotspot.<br class=""></blockquote>The fix is correct but too strict. For example, Serial and Parallel GC can use the same AOT library. CMS too.<br class=""></blockquote><br class="">Do you have other suggestions how to check compatibility?<br class=""></blockquote>I think the best way would be to use BarrierSet::Name:<br class="">// Do something for each concrete barrier set part of the build.<br class="">#define FOR_EACH_CONCRETE_BARRIER_SET_DO(f) \<br class=""> <span class="Apple-converted-space"> </span>f(CardTableBarrierSet) \<br class=""> <span class="Apple-converted-space"> </span>EPSILONGC_ONLY(f(EpsilonBarrierSet)) \<br class=""> <span class="Apple-converted-space"> </span>G1GC_ONLY(f(G1BarrierSet)) \<br class=""> <span class="Apple-converted-space"> </span>ZGC_ONLY(f(ZBarrierSet))<br class=""></blockquote><br style="caret-color: rgb(0, 0, 0); font-family: Verdana; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Verdana; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">Thank you, Chris, for suggestion.</span><br style="caret-color: rgb(0, 0, 0); font-family: Verdana; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: Verdana; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Verdana; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">To record barrier set in AOT library would require a lot more complex changes (JVMCI) not suitable for JDK 11. Currently Graal checks only GC flags. To get information about barrier set it needs to access Hotspot's data.</span><br style="caret-color: rgb(0, 0, 0); font-family: Verdana; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""></div></blockquote><div><br class=""></div>Yeah, that’s a problem.</div><div><br class=""><blockquote type="cite" class=""><div class=""><br style="caret-color: rgb(0, 0, 0); font-family: Verdana; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Verdana; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">The only simple way to relax the check is to get BarrierSet::Name value based on CollectedHeap::Name and compare them in aot library config check code. But I can't find a functionality in GC code to do that. I asked GC group.</span><br style="caret-color: rgb(0, 0, 0); font-family: Verdana; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: Verdana; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Verdana; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">Note, we never intended to support mixed GCs with the same type of barriers. It was accidental and I am not comfortable to support such "feature”.</span><br style="caret-color: rgb(0, 0, 0); font-family: Verdana; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""></div></blockquote><div><br class=""></div>You mean that two different GCs use the same barrier set? Yes, I agree, it would be better if each had their own.</div><div><br class=""></div><div>Do you want to push your current patch?</div><div><br class=""><blockquote type="cite" class=""><div class=""><br style="caret-color: rgb(0, 0, 0); font-family: Verdana; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Verdana; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">Vladimir</span><br style="caret-color: rgb(0, 0, 0); font-family: Verdana; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: Verdana; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><blockquote type="cite" style="font-family: Verdana; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><blockquote type="cite" class=""><br class="">Thanks,<br class="">Vladimir<br class=""><br class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><br class="">I verified the fix with all GCs combination when compiling AOT lib and using it. I also ran our hs-tier1-3 testing which includes AOT and Graal tests.<br class=""><br class="">These changes are for JDK 11 so I don't need to go through Graal PR now but I would need to do that for JDK 12 to make changes in AOT code.<br class=""><br class="">Thanks,<br class="">Vladimir<br class=""><br class="">[1] <a href="https://bugs.openjdk.java.net/browse/JDK-8205824" class="">https://bugs.openjdk.java.net/browse/JDK-8205824</a><br class=""> "[GR-10514] Use whitelist for GCs supported by Graal"<br class="">[2] <a href="http://hg.openjdk.java.net/jdk/jdk11/file/bf686c47c109/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalRuntime.java#l137" class="">http://hg.openjdk.java.net/jdk/jdk11/file/bf686c47c109/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalRuntime.java#l137</a><br class="">[3] <a href="http://hg.openjdk.java.net/jdk/jdk11/file/bf686c47c109/src/hotspot/share/gc/shared/collectedHeap.hpp#l173" class="">http://hg.openjdk.java.net/jdk/jdk11/file/bf686c47c109/src/hotspot/share/gc/shared/collectedHeap.hpp#l173</a></blockquote></blockquote></blockquote></blockquote></div></blockquote></div><br class=""></body></html>