<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="">Man.<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Jul 25, 2018, at 8:08 PM, Man Cao <<a href="mailto:manc@google.com" class="">manc@google.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; 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 class="">Thanks Karen for the response!</div><div class="">I don't have a JBS account currently. I could ask my colleagues with JBS accounts to create an RFE for this issue, but<span class="Apple-converted-space"> </span><span style="font-size: small; background-color: rgb(255, 255, 255); float: none; display: inline;" class="">probably </span>I cannot directly post comments or performance results on JBS.</div></div></div></blockquote>Sounds good - why don’t you work with a colleague who has a JBS account until you can become an Author.<br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; 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 class=""><br class=""></div><div class="">I'm working on upstreaming more Google-local runtime and GC patches, so I can become an Author, according to:</div><div class=""><a href="https://wiki.openjdk.java.net/display/general/JBS+Overview" class="">https://wiki.openjdk.java.net/display/general/JBS+Overview</a><br class=""></div><div class="">So far I have just contributed one patch: JDK-8193386.<br class=""></div><div class=""><br class=""></div><div class="">Can I just post performance results on the mailing list and someone could copy the results when creating an RFE?</div></div></div></blockquote>Sounds like you will be finding a colleague who can help to create the initial RFE. Feel free to work with</div><div>that colleague to add updates, or wait until you have the information to only need to ask them a favor once.</div><div><br class=""></div><div>thanks,</div><div>Karen<br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; 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 class=""><br class=""></div><div class="">-Man<br class=""></div><br class=""></div><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; 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 class="gmail_quote" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; 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;"><div dir="ltr" class="">On Wed, Jul 25, 2018 at 2:56 PM Karen Kinnear <<a href="mailto:karen.kinnear@oracle.com" target="_blank" class="">karen.kinnear@oracle.com</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div style="word-wrap: break-word; line-break: after-white-space;" class="">Man,<div class=""><br class=""></div><div class="">Thank you for your proposal. The runtime is the correct team.</div><div class=""><br class=""></div><div class="">Could you please file an rfe under hotspot/runtime with the information below and the patch as well as any</div><div class="">tests you have run and any performance results you have?</div><div class=""><br class=""></div><div class="">That will help us track this information and find you a sponsor.</div><div class=""><br class=""></div><div class="">thanks,</div><div class="">Karen<br class=""><div class=""><br class=""><blockquote type="cite" class=""><div class="">On Jul 18, 2018, at 9:53 PM, Man Cao <<a href="mailto:manc@google.com" target="_blank" class="">manc@google.com</a>> wrote:</div><br class="m_430936533030427191m_7612539909124851865m_-5151025259025481513Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="">Hello,</div><div class=""><br class=""></div><div class="">The Java platform team at Google has maintained a local patch to inline os::SpinPause() since 2014. We would like to upstream this patch to OpenJDK. Could someone sponsor this patch?</div><div class=""><br class=""></div><div class="">It is difficult to demonstrate performance improvement in Java benchmarks. It is more of a code refactoring to better utilize modern GCC. It partly addresses the comment about inlining SpinPause() above its declaration in os.hpp.</div><div class="">I found an interesting discussion about PAUSE and a microbenchmark in:<br class=""></div><div class=""><a href="http://mail.openjdk.java.net/pipermail/hotspot-runtime-dev/2012-August/004352.html" target="_blank" class="">http://mail.openjdk.java.net/pipermail/hotspot-runtime-dev/2012-August/004352.html</a><br class=""></div><div class="">However, the microbenchmark has a large variance in our experiment, making it difficult to tell if there's any benefit from inlining PAUSE. Inlining PAUSE does seem to reduce the variance a bit.</div><div class=""><br class=""></div><div class="">The patch is inlined and attached below:</div><div class=""><br class=""></div><div class=""><div class="">diff --git a/src/hotspot/os_cpu/bsd_x86/bsd_x86_32.s b/src/hotspot/os_cpu/bsd_x86/bsd_x86_32.s<br class=""></div><div class="">--- a/src/hotspot/os_cpu/bsd_x86/bsd_x86_32.s</div><div class="">+++ b/src/hotspot/os_cpu/bsd_x86/bsd_x86_32.s</div><div class="">@@ -63,15 +63,6 @@</div><div class=""> popl %eax</div><div class=""> ret</div><div class=""> </div><div class="">- .globl SYMBOL(SpinPause)</div><div class="">- ELF_TYPE(SpinPause,@function)</div><div class="">- .p2align 4,,15</div><div class="">-SYMBOL(SpinPause):</div><div class="">- rep</div><div class="">- nop</div><div class="">- movl $1, %eax</div><div class="">- ret</div><div class="">-</div><div class=""> # Support for void Copy::conjoint_bytes(void* from,</div><div class=""> # void* to,</div><div class=""> # size_t count)</div><div class="">diff --git a/src/hotspot/os_cpu/bsd_x86/bsd_x86_64.s b/src/hotspot/os_cpu/bsd_x86/bsd_x86_64.s</div><div class="">--- a/src/hotspot/os_cpu/bsd_x86/bsd_x86_64.s</div><div class="">+++ b/src/hotspot/os_cpu/bsd_x86/bsd_x86_64.s</div><div class="">@@ -46,15 +46,6 @@</div><div class=""> </div><div class=""> <span style="white-space: pre-wrap;" class=""> </span>.text</div><div class=""> </div><div class="">- .globl SYMBOL(SpinPause)</div><div class="">- .p2align 4,,15</div><div class="">- ELF_TYPE(SpinPause,@function)</div><div class="">-SYMBOL(SpinPause):</div><div class="">- rep</div><div class="">- nop</div><div class="">- movq $1, %rax</div><div class="">- ret</div><div class="">-</div><div class=""> # Support for void Copy::arrayof_conjoint_bytes(void* from,</div><div class=""> # void* to,</div><div class=""> # size_t count)</div><div class="">diff --git a/src/hotspot/os_cpu/linux_x86/linux_x86_32.s b/src/hotspot/os_cpu/linux_x86/linux_x86_32.s</div><div class="">--- a/src/hotspot/os_cpu/linux_x86/linux_x86_32.s</div><div class="">+++ b/src/hotspot/os_cpu/linux_x86/linux_x86_32.s</div><div class="">@@ -42,15 +42,6 @@</div><div class=""> </div><div class=""> <span style="white-space: pre-wrap;" class=""> </span>.text</div><div class=""> </div><div class="">- .globl SpinPause</div><div class="">-<span style="white-space: pre-wrap;" class=""> </span>.type SpinPause,@function</div><div class="">- .p2align 4,,15</div><div class="">-SpinPause:</div><div class="">- rep</div><div class="">- nop</div><div class="">- movl $1, %eax</div><div class="">- ret</div><div class="">-</div><div class=""> # Support for void Copy::conjoint_bytes(void* from,</div><div class=""> # void* to,</div><div class=""> # size_t count)</div><div class="">diff --git a/src/hotspot/os_cpu/linux_x86/linux_x86_64.s b/src/hotspot/os_cpu/linux_x86/linux_x86_64.s</div><div class="">--- a/src/hotspot/os_cpu/linux_x86/linux_x86_64.s</div><div class="">+++ b/src/hotspot/os_cpu/linux_x86/linux_x86_64.s</div><div class="">@@ -38,15 +38,6 @@</div><div class=""> </div><div class=""> <span style="white-space: pre-wrap;" class=""> </span>.text</div><div class=""> </div><div class="">- .globl SpinPause</div><div class="">- .align 16</div><div class="">- .type SpinPause,@function</div><div class="">-SpinPause:</div><div class="">- rep</div><div class="">- nop</div><div class="">- movq $1, %rax</div><div class="">- ret</div><div class="">-</div><div class=""> # Support for void Copy::arrayof_conjoint_bytes(void* from,</div><div class=""> # void* to,</div><div class=""> # size_t count)</div><div class="">diff --git a/src/hotspot/os_cpu/solaris_x86/solaris_x86_64.s b/src/hotspot/os_cpu/solaris_x86/solaris_x86_64.s</div><div class="">--- a/src/hotspot/os_cpu/solaris_x86/solaris_x86_64.s</div><div class="">+++ b/src/hotspot/os_cpu/solaris_x86/solaris_x86_64.s</div><div class="">@@ -51,15 +51,6 @@</div><div class=""> movq %fs:0x0,%rax</div><div class=""> ret</div><div class=""> </div><div class="">- .globl SpinPause</div><div class="">- .align 16</div><div class="">-SpinPause:</div><div class="">- rep</div><div class="">- nop</div><div class="">- movq $1, %rax</div><div class="">- ret</div><div class="">-</div><div class="">-</div><div class=""> / Support for void Copy::arrayof_conjoint_bytes(void* from,</div><div class=""> / void* to,</div><div class=""> / size_t count)</div><div class="">diff --git a/src/hotspot/share/runtime/os.hpp b/src/hotspot/share/runtime/os.hpp</div><div class="">--- a/src/hotspot/share/runtime/os.hpp</div><div class="">+++ b/src/hotspot/share/runtime/os.hpp</div><div class="">@@ -1031,6 +1031,13 @@</div><div class=""> // of the global SpinPause() with C linkage.</div><div class=""> // It'd also be eligible for inlining on many platforms.</div><div class=""> </div><div class="">+#if defined(X86) && !defined(_WINDOWS)</div><div class="">+extern "C" int inline SpinPause() {</div><div class="">+ __asm__ __volatile__ ("pause");</div><div class="">+ return 1;</div><div class="">+}</div><div class="">+#else</div><div class=""> extern "C" int SpinPause();</div><div class="">+#endif</div><div class=""> </div><div class=""> #endif // SHARE_VM_RUNTIME_OS_HPP</div></div><div class=""><br class=""></div><div class="">-Man<br class=""></div></div><span id="m_430936533030427191m_7612539909124851865m_-5151025259025481513cid:f_jjrvy2sw0" class=""><inline_spinpause.patch></span></div></blockquote></div></div></div></blockquote></div></div></blockquote></div><br class=""></body></html>