RFR(s): 8218145: block_if_requested is not proper inlined due to size

Gerard Ziemski gerard.ziemski at oracle.com
Fri Feb 1 16:34:49 UTC 2019


hi Robbin,

Looks good, but couldn’t we have:

  86 void SafepointMechanism::block_if_requested_slow(JavaThread *thread) {
  87   if (global_poll()) {
  88     SafepointSynchronize::block(thread);
  89   }
  90   if (uses_thread_local_poll() && thread->has_handshake()) {
  91     // local poll already checked
  92     thread->handshake_process_by_self();
  93   } // else { If we don't have per thread poll this could a handshake or a safepoint }
  94 }

instead of:

  86 void SafepointMechanism::block_if_requested_slow(JavaThread *thread) {
  87   if (uses_thread_local_poll()) {
  88     // local poll already checked
  89     if (global_poll()) {
  90       SafepointSynchronize::block(thread);
  91     }
  92     if (thread->has_handshake()) {
  93       thread->handshake_process_by_self();
  94     }
  95   } else {
  96     // If we don't have per thread poll this could a handshake or a safepoint
  97     if (global_poll()) {
  98       SafepointSynchronize::block(thread);
  99     }
 100   }
 101 }

if we want to reduce the code size?


cheers

> On Feb 1, 2019, at 3:54 AM, Robbin Ehn <robbin.ehn at oracle.com> wrote:
> 
> Hi all, please review.
> 
> Code:
> http://cr.openjdk.java.net/~rehn/8218145/webrev/index.html
> Issue:
> https://bugs.openjdk.java.net/browse/JDK-8218145
> 
> SafepointMechanism::block_if_requested(JavaThread*) is often not inlined to due inline-unit-growth.
> This improve the inlining frequency with 6-7x.
> Some startup benchmarks show 1% better time.
> 
> Test -+ThreadsLocalHandshakes and t1.
> 
> Note that we are planning to deprecate -ThreadsLocalHandshakes in 13, therefore -ThreadsLocalHandshakes is put in slow path to further reduce size.
> When we can remove the uses_thread_local_poll() it become so small it is always inlined. Arguably this method should have ALWAYSINLINE, but I would prefer not.
> 
> Thanks, Robbin



More information about the hotspot-runtime-dev mailing list