<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=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<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;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
tt
        {mso-style-priority:99;
        font-family:"Courier New";}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
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="DE" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Hello everybody,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">thanks for finding this issue. New webrev is here:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">http://cr.openjdk.java.net/~mdoerr/8155949_relaxed_cas/webrev.02/<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Best regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Martin<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"><b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Hiroshi H Horii [mailto:HORII@jp.ibm.com]
<br>
<b>Sent:</b> Dienstag, 10. Mai 2016 15:18<br>
<b>To:</b> David Holmes <david.holmes@oracle.com><br>
<b>Cc:</b> hotspot-gc-dev@openjdk.java.net; hotspot-runtime-dev@openjdk.java.net; ppc-aix-port-dev@openjdk.java.net; Tim Ellison <Tim_Ellison@uk.ibm.com>; Doerr, Martin <martin.doerr@sap.com><br>
<b>Subject:</b> Re: RFR(M): 8155949: Support relaxed semantics in cmpxchg<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-size:10.0pt;font-family:"Arial",sans-serif">Hi David,</span><br>
<br>
<span style="font-size:10.0pt;font-family:"Arial",sans-serif">> Just need another reviewer to chime in - given you and Martin are both</span><br>
<span style="font-size:10.0pt;font-family:"Arial",sans-serif">> contributors. Or are you the main contributor with Martin being a reviewer?</span><br>
<br>
<span style="font-size:10.0pt;font-family:"Arial",sans-serif">Martin and I are contributors of this change.</span><br>
<br>
<span style="font-size:10.0pt;font-family:"Arial",sans-serif">> Still a problem on Solaris sparc:</span><br>
<br>
<span style="font-size:10.0pt;font-family:"Arial",sans-serif">Martin, could you create a new change in webrev with the patch that David sent?</span><br>
<br>
<span lang="EN-US" style="font-size:10.0pt;font-family:"Arial",sans-serif">Regards,<br>
Hiroshi<br>
-----------------------<br>
Hiroshi Horii, Ph.D.<br>
IBM Research - Tokyo<br>
</span><span lang="EN-US"><br>
<br>
</span><tt><span lang="EN-US" style="font-size:10.0pt">David Holmes <</span></tt><tt><span style="font-size:10.0pt"><a href="mailto:david.holmes@oracle.com"><span lang="EN-US">david.holmes@oracle.com</span></a></span></tt><tt><span lang="EN-US" style="font-size:10.0pt">>
 wrote on 05/10/2016 21:29:53:</span></tt><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New""><br>
<br>
<tt>> From: David Holmes <</tt></span><tt><span style="font-size:10.0pt"><a href="mailto:david.holmes@oracle.com"><span lang="EN-US">david.holmes@oracle.com</span></a></span></tt><tt><span lang="EN-US" style="font-size:10.0pt">></span></tt><span lang="EN-US"><br>
</span><tt><span lang="EN-US" style="font-size:10.0pt">> To: Hiroshi H Horii/Japan/IBM@IBMJP, "hotspot-runtime-</span></tt><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New""><br>
<tt>> </tt></span><tt><span style="font-size:10.0pt"><a href="mailto:dev@openjdk.java.net"><span lang="EN-US">dev@openjdk.java.net</span></a></span></tt><tt><span lang="EN-US" style="font-size:10.0pt">" <</span></tt><tt><span style="font-size:10.0pt"><a href="mailto:hotspot-runtime-dev@openjdk.java.net"><span lang="EN-US">hotspot-runtime-dev@openjdk.java.net</span></a></span></tt><tt><span lang="EN-US" style="font-size:10.0pt">></span></tt><span lang="EN-US"><br>
</span><tt><span lang="EN-US" style="font-size:10.0pt">> Cc: Tim Ellison <</span></tt><tt><span style="font-size:10.0pt"><a href="mailto:Tim_Ellison@uk.ibm.com"><span lang="EN-US">Tim_Ellison@uk.ibm.com</span></a></span></tt><tt><span lang="EN-US" style="font-size:10.0pt">>,
 "ppc-aix-port-</span></tt><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New""><br>
<tt>> </tt></span><tt><span style="font-size:10.0pt"><a href="mailto:dev@openjdk.java.net"><span lang="EN-US">dev@openjdk.java.net</span></a></span></tt><tt><span lang="EN-US" style="font-size:10.0pt">" <</span></tt><tt><span style="font-size:10.0pt"><a href="mailto:ppc-aix-port-dev@openjdk.java.net"><span lang="EN-US">ppc-aix-port-dev@openjdk.java.net</span></a></span></tt><tt><span lang="EN-US" style="font-size:10.0pt">>,
 "hotspot-</span></tt><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New""><br>
<tt>> </tt></span><tt><span style="font-size:10.0pt"><a href="mailto:gc-dev@openjdk.java.net"><span lang="EN-US">gc-dev@openjdk.java.net</span></a></span></tt><tt><span lang="EN-US" style="font-size:10.0pt">" <</span></tt><tt><span style="font-size:10.0pt"><a href="mailto:hotspot-gc-dev@openjdk.java.net"><span lang="EN-US">hotspot-gc-dev@openjdk.java.net</span></a></span></tt><tt><span lang="EN-US" style="font-size:10.0pt">></span></tt><span lang="EN-US"><br>
</span><tt><span lang="EN-US" style="font-size:10.0pt">> Date: 05/10/2016 21:31</span></tt><span lang="EN-US"><br>
</span><tt><span lang="EN-US" style="font-size:10.0pt">> Subject: Re: RFR(M): 8155949: Support relaxed semantics in cmpxchg</span></tt><span lang="EN-US"><br>
</span><tt><span lang="EN-US" style="font-size:10.0pt">> </span></tt><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New""><br>
<tt>> On 10/05/2016 9:04 PM, David Holmes wrote:</tt><br>
<tt>> > Hi Hiroshi,</tt><br>
<tt>> ></tt><br>
<tt>> > On 10/05/2016 8:44 PM, Hiroshi H Horii wrote:</tt><br>
<tt>> >> Hi All,</tt><br>
<tt>> >></tt><br>
<tt>> >> Can I please request reviews for the following change?</tt><br>
</span><tt><span style="font-size:10.0pt">> >></span></tt><span style="font-size:10.0pt;font-family:"Courier New""><br>
<tt>> >> Code change:</tt><br>
<tt>> >> </tt></span><a href="http://cr.openjdk.java.net/~mdoerr/8155949_relaxed_cas/webrev.01/"><tt><span style="font-size:10.0pt">http://cr.openjdk.java.net/~mdoerr/8155949_relaxed_cas/webrev.01/</span></tt></a><span style="font-size:10.0pt;font-family:"Courier New""><br>
<tt>> ></tt><br>
<tt>> > Changes look good. I'm currently running them through our internal build</tt><br>
<tt>> > system. I will sponsor this and push the change through JPRT.</tt><br>
<tt>> </tt><br>
<tt>> Still a problem on Solaris sparc:</tt><br>
<tt>> </tt><br>
<tt>> "/opt/jprt/T/P1/102505.daholme/s/hotspot/src/share/vm/runtime/</tt><br>
<tt>> atomic.inline.hpp", </tt><br>
<tt>> line 96: Error: Could not find a match for static Atomic::cmpxchg(signed </tt>
<br>
<tt>> char, volatile signed char*, signed char).</tt><br>
<tt>> 1 Error(s) detected.</tt><br>
<tt>> </tt><br>
<tt>> Needs this patch:</tt><br>
<tt>> </tt><br>
<tt>> diff -r 68853ef19be9 src/share/vm/runtime/atomic.inline.hpp</tt><br>
<tt>> --- a/src/share/vm/runtime/atomic.inline.hpp</tt><br>
<tt>> +++ b/src/share/vm/runtime/atomic.inline.hpp</tt><br>
<tt>> @@ -92,7 +92,7 @@</tt><br>
<tt>> </tt><br>
<tt>>   #ifndef VM_HAS_SPECIALIZED_CMPXCHG_BYTE</tt><br>
<tt>>   // See comment in atomic.cpp how to override.</tt><br>
<tt>> -inline jbyte Atomic::cmpxchg(jbyte exchange_value, volatile jbyte </tt><br>
<tt>> *dest, jbyte comparand)</tt><br>
<tt>> +inline jbyte Atomic::cmpxchg(jbyte exchange_value, volatile jbyte </tt><br>
<tt>> *dest, jbyte comparand, cmpxchg_memory_order order)</tt><br>
<tt>>   {</tt><br>
<tt>>     return cmpxchg_general(exchange_value, dest, comparand);</tt><br>
<tt>>   }</tt><br>
<tt>> </tt><br>
<tt>> David</tt><br>
<tt>> -----</tt><br>
<tt>> </tt><br>
<tt>> > Just need another reviewer to chime in - given you and Martin are both</tt><br>
<tt>> > contributors. Or are you the main contributor with Martin being a reviewer?</tt><br>
<tt>> ></tt><br>
<tt>> > Thanks,</tt><br>
<tt>> > David</tt><br>
<tt>> ></tt><br>
<tt>> > PS. It's my night now so I'll be signing off and will pick this up in</tt><br>
<tt>> > the morning.</tt><br>
<tt>> ></tt><br>
<tt>> >> This change follows the discussion started from these mails.</tt><br>
<tt>> >> </tt></span><a href="http://mail.openjdk.java.net/pipermail/hotspot-runtime-dev/2016-"><tt><span style="font-size:10.0pt">http://mail.openjdk.java.net/pipermail/hotspot-runtime-dev/2016-</span></tt></a><span style="font-size:10.0pt;font-family:"Courier New""><br>
<tt>> April/018960.html</tt><br>
<tt>> >></tt><br>
<tt>> >> </tt></span><a href="http://mail.openjdk.java.net/pipermail/hotspot-runtime-dev/2016-"><tt><span style="font-size:10.0pt">http://mail.openjdk.java.net/pipermail/hotspot-runtime-dev/2016-</span></tt></a><span style="font-size:10.0pt;font-family:"Courier New""><br>
<tt>> April/019148.html</tt><br>
<tt>> >></tt><br>
<tt>> >> </tt></span><a href="http://mail.openjdk.java.net/pipermail/hotspot-runtime-dev/2016-"><tt><span style="font-size:10.0pt">http://mail.openjdk.java.net/pipermail/hotspot-runtime-dev/2016-</span></tt></a><span style="font-size:10.0pt;font-family:"Courier New""><br>
<tt>> May/019320.html</tt><br>
<tt>> >></tt><br>
<tt>> >></tt><br>
<tt>> >> Description:</tt><br>
<tt>> >> This change provides relaxed compare-and-exchange by introducing</tt><br>
<tt>> >> relaxed memory order. As described in atomic_linux_ppc.inline.hpp,</tt><br>
<tt>> >> the current implementation of cmpxchg is fence_cmpxchg_acquire.</tt><br>
<tt>> >> This implementation is useful for general purposes because twice calls of</tt><br>
<tt>> >> sync before and after cmpxchg will provide strict consistency.</tt><br>
<tt>> >> However, they sometimes cause overheads because sync instructions are</tt><br>
<tt>> >> very expensive in the current POWER chip design.</tt><br>
<tt>> >></tt><br>
<tt>> >> We confirmed this change improves performance of copy_to_survivor</tt><br>
<tt>> >> in the parallel GC. However, we will need more investigation of GC</tt><br>
<tt>> >> by more experts. So, We would like to request a review of the change</tt><br>
<tt>> >> of cmpxchg first (as Martin requested).</tt><br>
<tt>> >> </tt></span><a href="http://mail.openjdk.java.net/pipermail/hotspot-runtime-dev/2016-"><tt><span style="font-size:10.0pt">http://mail.openjdk.java.net/pipermail/hotspot-runtime-dev/2016-</span></tt></a><span style="font-size:10.0pt;font-family:"Courier New""><br>
<tt>> April/019188.html</tt><br>
<tt>> >></tt><br>
<tt>> >></tt><br>
<tt>> >> Summary of source code changes:</tt><br>
<tt>> >></tt><br>
<tt>> >> * src/share/vm/runtime/atomic.hpp</tt><br>
<tt>> >>      - Defines enum memory_order and adds a parameter to cmpxchg.</tt><br>
<tt>> >></tt><br>
<tt>> >> * src/share/vm/runtime/atomic.cpp</tt><br>
<tt>> >> * src/os_cpu/bsd_x86/vm/atomic_bsd_x86.inline.hpp</tt><br>
<tt>> >> * src/os_cpu/bsd_zero/vm/atomic_bsd_zero.inline.hpp</tt><br>
<tt>> >> * src/os_cpu/linux_aarch64/vm/atomic_linux_aarch64.inline.hpp</tt><br>
<tt>> >> * src/os_cpu/linux_sparc/vm/atomic_linux_sparc.inline.hpp</tt><br>
<tt>> >> * src/os_cpu/linux_x86/vm/atomic_linux_x86.inline.hpp</tt><br>
<tt>> >> * src/os_cpu/linux_zero/vm/atomic_linux_zero.inline.hpp</tt><br>
<tt>> >> * src/os_cpu/solaris_sparc/vm/atomic_solaris_sparc.inline.hpp</tt><br>
<tt>> >> * src/os_cpu/solaris_x86/vm/atomic_solaris_x86.inline.hpp</tt><br>
<tt>> >> * src/os_cpu/windows_x86/vm/atomic_windows_x86.inline.hpp</tt><br>
<tt>> >>      - Added a parameter for each cmpxchg function to follow</tt><br>
<tt>> >>         the change of atomic.hpp. Their implementations are not changed.</tt><br>
<tt>> >></tt><br>
<tt>> >> * src/os_cpu/aix_ppc/vm/atomic_aix_ppc.inline.hpp</tt><br>
<tt>> >> * src/os_cpu/linux_ppc/vm/atomic_linux_ppc.inline.hpp</tt><br>
<tt>> >>      - Added a parameter for each cmpxchg function to follow</tt><br>
<tt>> >>         the change of atomic.hpp. In addition, implementations</tt><br>
<tt>> >>         are changed corresponding to the specified memory_order.</tt><br>
<tt>> >></tt><br>
<tt>> >> Regards,</tt><br>
<tt>> >> Hiroshi</tt><br>
<tt>> >> -----------------------</tt><br>
<tt>> >> Hiroshi Horii, Ph.D.</tt><br>
<tt>> >> IBM Research - Tokyo</tt><br>
<tt>> >></tt><br>
<tt>> </tt></span><o:p></o:p></p>
</div>
</body>
</html>