<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 class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hello,<br>
<br>
</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I was looking at whether it would be valid to remove the acquire from safepoint_poll completely from here which emits an ldar instead of a ldr for memory ordering. [1] As currently, there is only a single instance of this argument being used, in the panama
downstream ffi. [2]</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
And similar changes have been made to remove the acquire argument from other native methods [3] with the reasoning being that threads now disarm their own poll value and hence an ldar is no longer needed. Hence the same reasoning should apply when removing
the acquire from the safepoint_poll used in the panama ffi and all other uses of safepoint_poll (especially since panama ffi is the only one which uses acquire). If it applies, this means the acquire argument functionality should be able to be removed completely
from the safepoint_poll method.<br>
<br>
</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
This change seemed to have been allowed when concurrent thread-stack processing and watermarking was introduced and the SafepointMechanism::update_poll_values method was updated such that the poll value could not be armed when leaving this method. [4] [5] As
previously this may have not been the case as it could exit this function with an armed poll value. [6]</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Given the complexity of the code - particularly around safepoints and thread-handshake mechanisms, which have evolved significantly over time - I’d like to clarify a few aspects to ensure this change is correct.<br>
My questions are:<br>
<br>
</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
1. What specifically allowed this change to be made to the other JNIs? Why is the ldar acquire no longer needed?<br>
2. Is there a reason why this was not done to the panama FFI safepoint_poll when the acquire arguments were removed from the other JNIs in [3]?<br>
3. Why is a load_acquire required here [7] for before the handshake operation or global state but not from some of the existing jit-emitted code?<br>
4. Why did the introduction of watermarking introduce both a poll word and poll page? Why is both needed?<br>
5. And any more additional context on how safepointing and poll values work.<br>
<br>
Any clarification on the matter would be much appreciated!</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Samuel Chee<br>
<br>
<br>
</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
[1] <span style="color: rgba(var(--sk_highlight,18,100,163),1);"><u><a href="https://github.com/openjdk/jdk/blob/4c695fa8a459adcdb8cdfe9e90783007c65fb90e/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp#L556" target="_blank" id="OWAb621448b-22f4-2f2e-affc-2a405c162309" class="c-link c-link--underline OWAAutoLink elementToProof" rel="noopener noreferrer" style="color: rgba(var(--sk_highlight,18,100,163),1); text-align: left;" data-sk="tooltip_parent" data-stringify-link="https://github.com/openjdk/jdk/blob/4c695fa8a459adcdb8cdfe9e90783007c65fb90e/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp#L556">https://github.com/openjdk/jdk/blob/4c695fa8a459adcdb8cdfe9e90783007c65fb90e/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp#L556</a></u></span></div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
[2] <span style="color: rgba(var(--sk_highlight,18,100,163),1);"><u><a href="https://github.com/openjdk/jdk/blob/482538b100856afe2252395d47e576e6c6d885ce/src/hotspot/cpu/aarch64/downcallLinker_aarch64.cpp#L292" target="_blank" id="OWAeb591916-e5b5-6797-9985-04f54044efdb" class="c-link c-link--underline OWAAutoLink elementToProof" rel="noopener noreferrer" style="color: rgba(var(--sk_highlight,18,100,163),1); text-align: left;" data-sk="tooltip_parent" data-stringify-link="https://github.com/openjdk/jdk/blob/482538b100856afe2252395d47e576e6c6d885ce/src/hotspot/cpu/aarch64/downcallLinker_aarch64.cpp#L292">https://github.com/openjdk/jdk/blob/482538b100856afe2252395d47e576e6c6d885ce/src/hotspot/cpu/aarch64/downcallLinker_aarch64.cpp#L292</a></u></span></div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
[3] <span style="color: rgba(var(--sk_highlight,18,100,163),1);"><u><a href="https://bugs.openjdk.org/browse/JDK-8337657" target="_blank" id="OWA46a228ec-a659-7744-3f12-e06365b1b77c" class="c-link c-link--underline OWAAutoLink elementToProof" rel="noopener noreferrer" style="color: rgba(var(--sk_highlight,18,100,163),1); text-align: left;" data-sk="tooltip_parent" data-stringify-link="https://bugs.openjdk.org/browse/JDK-8337657">https://bugs.openjdk.org/browse/JDK-8337657</a></u></span></div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
[4] <span style="color: rgba(var(--sk_highlight,18,100,163),1);"><u><a href="https://github.com/openjdk/jdk/pull/296/files#diff-2a18ec5d55c3c0c18669d55ff48fb455b633d152132915caf65766e41a5a58ab" target="_blank" id="OWA9455b9a4-28e9-cecb-c1be-e6efbda5094a" class="c-link c-link--underline OWAAutoLink elementToProof" rel="noopener noreferrer" style="color: rgba(var(--sk_highlight,18,100,163),1); text-align: left;" data-sk="tooltip_parent" data-stringify-link="https://github.com/openjdk/jdk/pull/296/files#diff-2a18ec5d55c3c0c18669d55ff48fb455b633d152132915caf65766e41a5a58ab">https://github.com/openjdk/jdk/pull/296/files#diff-2a18ec5d55c3c0c18669d55ff48fb455b633d152132915caf65766e41a5a58ab</a></u></span></div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
[5] <span style="color: rgba(var(--sk_highlight,18,100,163),1);"><u><a href="https://openjdk.org/jeps/376" target="_blank" id="OWA58a180f7-2f6d-f9bf-f489-07f0ccb84f2c" class="c-link c-link--underline OWAAutoLink elementToProof" rel="noopener noreferrer" style="color: rgba(var(--sk_highlight,18,100,163),1); text-align: left;" data-sk="tooltip_parent" data-stringify-link="https://openjdk.org/jeps/376">https://openjdk.org/jeps/376</a></u></span></div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
[6] <span style="color: rgba(var(--sk_highlight,18,100,163),1);"><u><a href="https://github.com/openjdk/jdk/blob/a2f651904d1a1fdb14428be5485709b8ff252331/src/hotspot/share/runtime/safepointMechanism.cpp#L86" target="_blank" id="OWAe888e568-edff-4289-344e-8c1144364470" class="c-link c-link--underline OWAAutoLink elementToProof" rel="noopener noreferrer" style="color: rgba(var(--sk_highlight,18,100,163),1); text-align: left;" data-sk="tooltip_parent" data-stringify-link="https://github.com/openjdk/jdk/blob/a2f651904d1a1fdb14428be5485709b8ff252331/src/hotspot/share/runtime/safepointMechanism.cpp#L86">https://github.com/openjdk/jdk/blob/a2f651904d1a1fdb14428be5485709b8ff252331/src/hotspot/share/runtime/safepointMechanism.cpp#L86</a></u></span>,</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
[7] <span style="color: rgba(var(--sk_highlight,18,100,163),1);"><u><a href="https://github.com/openjdk/jdk/blob/765cef45465806e53f11fa7d92b9c184899b0932/src/hotspot/share/runtime/safepointMechanism.inline.hpp#L48" target="_blank" id="OWAc623aae8-d232-a338-4cd0-019065bce9ee" class="c-link c-link--underline OWAAutoLink elementToProof" rel="noopener noreferrer" style="color: rgba(var(--sk_highlight,18,100,163),1); text-align: left;" data-sk="tooltip_parent" data-stringify-link="https://github.com/openjdk/jdk/blob/765cef45465806e53f11fa7d92b9c184899b0932/src/hotspot/share/runtime/safepointMechanism.inline.hpp#L48">https://github.com/openjdk/jdk/blob/765cef45465806e53f11fa7d92b9c184899b0932/src/hotspot/share/runtime/safepointMechanism.inline.hpp#L48</a></u></span></div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose,
or store or copy the information in any medium. Thank you.
</body>
</html>