<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof ContentPasted0">
Hi Sergey,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof ContentPasted0">
<div><br class="ContentPasted0">
</div>
<div class="ContentPasted0">> Is this blocking you? As workaround I can prepare simple barriers</div>
<div class="ContentPasted0">> implementation enough to run SerialGC.</div>
<div><br class="ContentPasted0">
</div>
<div class="ContentPasted0">The entry barriers are required for G1. Without you can get a corrupted java heap.</div>
<div class="ContentPasted0">Here's a reproducer: <a href="https://bugs.openjdk.org/browse/JDK-8288970?focusedCommentId=14520842&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-14520842" id="LPlnk104171">
https://bugs.openjdk.org/browse/JDK-8288970?focusedCommentId=14520842&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-14520842</a></div>
<div class="ContentPasted0">It should fail on ARM32.</div>
<div><br class="ContentPasted0">
</div>
<div class="ContentPasted0">I'd like to do https://github.com/openjdk/jdk/pull/11314 which will make that type of issue more likely.</div>
<div><br class="ContentPasted0">
</div>
<div class="ContentPasted0">SerialGC and ParallelGC are not affected.</div>
<div><br class="ContentPasted0">
</div>
<div class="ContentPasted0">> Unfortunately we have no plan for this activity. I’m not familiar with the</div>
<div class="ContentPasted0">> problem so can’t estimate the time required to implement the functionality.</div>
<div><br class="ContentPasted0">
</div>
<div class="ContentPasted0">A nmethod barrier is nothing too complicated. Without support for ZGC/Shenandoah</div>
<div class="ContentPasted0">it is basically a conditional runtime call with</div>
<div class="ContentPasted0">BarrierSetNMethod::nmethod_stub_entry_barrier() as target. Without</div>
<div class="ContentPasted0">ZGC/Shenandoah you can implement BarrierSetNMethod::deoptimize() as</div>
<div class="ContentPasted0">ShouldNotReachHere() because BarrierSetNMethod::nmethod_entry_barrier() always</div>
<div class="ContentPasted0">returns true (nmethod can be entered).</div>
<div><br class="ContentPasted0">
</div>
<div class="ContentPasted0">The actual AARCH64 implementation is optimized and a little bit complex. It is</div>
<div class="ContentPasted0">sufficient to implement the NMethodPatchingType::stw_instruction_and_data_patch</div>
<div class="ContentPasted0">part without the extra C2 stub, i.e. slow_path==NULL in BarrierSetAssembler::nmethod_entry_barrier(..., slow_path, ...)</div>
<div><br class="ContentPasted0">
</div>
<div class="ContentPasted0">I hardly know ARM but I really don't think it would be a lot of effort to</div>
<div class="ContentPasted0">implement it.</div>
<div><br class="ContentPasted0">
</div>
<div class="ContentPasted0">Best regards,</div>
<div class="ContentPasted0">Richard.</div>
<br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Sergey Nazarkin <snazarkin@azul.com><br>
<b>Sent:</b> Tuesday, November 29, 2022 15:29<br>
<b>To:</b> Reingruber, Richard <richard.reingruber@sap.com><br>
<b>Cc:</b> porters-dev@openjdk.org <porters-dev@openjdk.org>; boris.ulasevich@bell-sw.com <boris.ulasevich@bell-sw.com><br>
<b>Subject:</b> Re: Missing nmethod entry barriers on ARM32</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Hi Richard,<br>
<br>
Unfortunately we have no plan for this activity. I’m not familiar with the problem so can’t estimate the time required to implement the functionality. Is this blocking you? As workaround I can prepare simple barriers implementation enough to run SerialGC.  
<br>
<br>
With best regards,<br>
<br>
Sergey<br>
<br>
<br>
<br>
> On 28 Nov 2022, at 13:03, Reingruber, Richard <richard.reingruber@sap.com> wrote:<br>
> <br>
> Dear ARM32 Maintainers, Boris, Sergey, [1]<br>
> <br>
> ARM32 does not implement nmethod entry barriers (see <a href="https://bugs.openjdk.org/browse/JDK-8291302)">
https://bugs.openjdk.org/browse/JDK-8291302)</a>.<br>
> <br>
> This is actually a defect because nmethod entry barriers are a G1 requirement where they are needed during concurrent marking to keep alive nmethod oop constants as they are all weak oops[2].<br>
> <br>
> I'd like to do a clean-up which removes redundant stackwalks from the G1 remark pause[3]. With nmethod entry barriers they are not necessary as they do the same keep alive for oop constants of nmethods found on stack. Without nmethod barriers (ARM32) these
 stackwalks are not sufficient though as every nmethod that is called during concurrent marking needs to do the keep alive for SATB.<br>
> <br>
> Could you share your plans regarding the implementation of nmethod entry barriers? How would you like me to handle ARM32 in the intended clean-up?<br>
> <br>
> Thanks,<br>
> Richard.<br>
> <br>
> [1] found you on <a href="https://wiki.openjdk.org/display/HotSpot/Ports">https://wiki.openjdk.org/display/HotSpot/Ports</a><br>
> [2] <a href="https://bugs.openjdk.org/browse/JDK-8288970">https://bugs.openjdk.org/browse/JDK-8288970</a><br>
> [3] <a href="https://github.com/openjdk/jdk/pull/11314">https://github.com/openjdk/jdk/pull/11314</a><br>
<br>
</div>
</span></font></div>
</body>
</html>