RFR: Temporarily disable ThreadLocalHandshakes with Shenandoah

Aleksey Shipilev shade at redhat.com
Thu Feb 22 12:18:10 UTC 2018


We have been following up on some weird compiler-related failures in sh/jdk10 and sh/jdk, and we
narrowed it down to interaction with C2 and ThreadLocalHandshakes. The problem is that TLH are
enabled by default, and we got that during recent sh/jdk10 merge. Let us disable TLH for a while,
until the problem is resolved:

diff -r cb3852700339 src/hotspot/share/gc/shenandoah/shenandoahArguments.cpp
--- a/src/hotspot/share/gc/shenandoah/shenandoahArguments.cpp	Thu Feb 22 10:34:43 2018 +0100
+++ b/src/hotspot/share/gc/shenandoah/shenandoahArguments.cpp	Thu Feb 22 13:15:32 2018 +0100
@@ -102,6 +102,18 @@
     FLAG_SET_DEFAULT(ShenandoahAlwaysPreTouch, true);
   }

+  // Shenandoah C2 optimizations apparently dislike the shape of thread-local handshakes.
+  // Disable it by default, unless we enable it specifically for debugging.
+  if (FLAG_IS_DEFAULT(ThreadLocalHandshakes)) {
+    if (ThreadLocalHandshakes) {
+      FLAG_SET_DEFAULT(ThreadLocalHandshakes, false);
+    }
+  } else {
+    if (ThreadLocalHandshakes) {
+      warning("Thread-local handshakes are not working correctly with Shenandoah at the moment.
Enable at your own risk.");
+    }
+  }
+
   if (ShenandoahConcurrentEvacCodeRoots) {
     if (!ShenandoahBarriersForConst) {
       if (FLAG_IS_DEFAULT(ShenandoahBarriersForConst)) {
diff -r cb3852700339 src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp
--- a/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp	Thu Feb 22 10:34:43 2018 +0100
+++ b/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp	Thu Feb 22 13:15:32 2018 +0100
@@ -332,6 +332,10 @@

   ShenandoahCodeRoots::initialize();

+  log_info(gc, init)("Safepointing mechanism: %s",
+                     SafepointMechanism::uses_thread_local_poll() ? "thread-local poll" :
+                     (SafepointMechanism::uses_global_page_poll() ? "global-page poll" : "unknown"));
+
   return JNI_OK;
 }

Testing: hotspot_gc_shenandoah

Thanks,
-Aleksey



More information about the shenandoah-dev mailing list