<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
span.EmailStyle19
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="en-DE" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">Great, thanks! I’ve already commented on the pr (https://github.com/openjdk/jdk/pull/11442).<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">Thanks, Richard.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span style="font-size:12.0pt;color:black">From:
</span></b><span style="font-size:12.0pt;color:black">Boris Ulasevich <boris.ulasevich@bell-sw.com><br>
<b>Date: </b>Thursday, 1. December 2022 at 09:00<br>
<b>To: </b>Reingruber, Richard <richard.reingruber@sap.com>, Sergey Nazarkin <snazarkin@azul.com><br>
<b>Cc: </b>porters-dev@openjdk.org <porters-dev@openjdk.org><br>
<b>Subject: </b>Re: Missing nmethod entry barriers on ARM32<o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Hi,<br>
<br>
As I know, the change for JDK-8291302 "ARM32: nmethod entry barriers support" is ready and going to be published in a few days.<br>
<br>
thanks,<br>
Boris<o:p></o:p></p>
<div>
<p class="MsoNormal">On 11/30/2022 12:07 AM, Reingruber, Richard wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">Hi Sergey,<o:p></o:p></span></p>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">> Is this blocking you? As workaround I can prepare simple barriers<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">> implementation enough to run SerialGC.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">The entry barriers are required for G1. Without you can get a corrupted java heap.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">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">
https://bugs.openjdk.org/browse/JDK-8288970?focusedCommentId=14520842&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-14520842</a><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">It should fail on ARM32.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">I'd like to do <a href="https://github.com/openjdk/jdk/pull/11314">
https://github.com/openjdk/jdk/pull/11314</a> which will make that type of issue more likely.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">SerialGC and ParallelGC are not affected.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">> Unfortunately we have no plan for this activity. I’m not familiar with the<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">> problem so can’t estimate the time required to implement the functionality.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">A nmethod barrier is nothing too complicated. Without support for ZGC/Shenandoah<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">it is basically a conditional runtime call with<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">BarrierSetNMethod::nmethod_stub_entry_barrier() as target. Without<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">ZGC/Shenandoah you can implement BarrierSetNMethod::deoptimize() as<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">ShouldNotReachHere() because BarrierSetNMethod::nmethod_entry_barrier() always<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">returns true (nmethod can be entered).<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">The actual AARCH64 implementation is optimized and a little bit complex. It is<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">sufficient to implement the NMethodPatchingType::stw_instruction_and_data_patch<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">part without the extra C2 stub, i.e. slow_path==NULL in BarrierSetAssembler::nmethod_entry_barrier(..., slow_path, ...)<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">I hardly know ARM but I really don't think it would be a lot of effort to<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">implement it.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">Best regards,<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">Richard.<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
</div>
<div class="MsoNormal" align="center" style="text-align:center">
<hr size="0" width="100%" align="center">
</div>
<div id="divRplyFwdMsg">
<p class="MsoNormal"><b><span style="color:black">From:</span></b><span style="color:black"> Sergey Nazarkin
<a href="mailto:snazarkin@azul.com"><snazarkin@azul.com></a><br>
<b>Sent:</b> Tuesday, November 29, 2022 15:29<br>
<b>To:</b> Reingruber, Richard <a href="mailto:richard.reingruber@sap.com"><richard.reingruber@sap.com></a><br>
<b>Cc:</b> <a href="mailto:porters-dev@openjdk.org">porters-dev@openjdk.org</a> <a href="mailto:porters-dev@openjdk.org">
<porters-dev@openjdk.org></a>; <a href="mailto:boris.ulasevich@bell-sw.com">boris.ulasevich@bell-sw.com</a>
<a href="mailto:boris.ulasevich@bell-sw.com"><boris.ulasevich@bell-sw.com></a><br>
<b>Subject:</b> Re: Missing nmethod entry barriers on ARM32</span> <o:p></o:p></p>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">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 <a href="mailto:richard.reingruber@sap.com">
<richard.reingruber@sap.com></a> 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><o:p></o:p></p>
</div>
</div>
</blockquote>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>