RFR: Temporarily disable ThreadLocalHandshakes with Shenandoah
Roman Kennke
rkennke at redhat.com
Thu Feb 22 12:25:28 UTC 2018
I just checked why sh-conc-mark does not suffer the same problem.
There, we init the liveness arrays at top of mark loop, and flush it
at the end. This way, we can never get a mismatch of workers. We
should just do the same:
http://cr.openjdk.java.net/~rkennke/init-extra-liveness/webrev.02/
Test: TestGCThreadGroups.java which used to sometimes fail
On Thu, Feb 22, 2018 at 1:21 PM, Roman Kennke <rkennke at redhat.com> wrote:
> Yes please
>
> On Thu, Feb 22, 2018 at 1:18 PM, Aleksey Shipilev <shade at redhat.com> wrote:
>> 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