[8u] RFR: Shenandoah: fix forceful pacer claim

Aleksey Shipilev shade at redhat.com
Thu Jul 23 09:38:45 UTC 2020


Hey,

Looks like we have a little day-1 bug in sh/jdk8.

Compare:
 8u:
https://hg.openjdk.java.net/shenandoah/jdk8/hotspot/file/e276bbfff22f/src/share/vm/gc_implementation/shenandoah/shenandoahPacer.cpp#l216
 head:
https://hg.openjdk.java.net/jdk/jdk/file/6c6087cff3bb/src/hotspot/share/gc/shenandoah/shenandoahPacer.cpp#l209

So on the pacer blocking path, we do not forcefully claim the pacing budget, which means pacer
allows more slack than it should. I believe this was the 8u backport where I added "force"
parameter, but omitted actually using it:
  https://hg.openjdk.java.net/shenandoah/jdk8/hotspot/rev/5114410c2684#l6.18

This went largely unnoticed, because current 8u code does not check the result of claim_for_alloc.
But it does so with JDK-8247367 backport and it fails the assert:
  https://hg.openjdk.java.net/jdk/jdk/rev/a39eb5a4f1c1#l1.28

sh/jdk8 fix is to match jdk/jdk:

diff -r 0067bf851998 src/share/vm/gc_implementation/shenandoah/shenandoahPacer.cpp
--- a/src/share/vm/gc_implementation/shenandoah/shenandoahPacer.cpp     Wed Jun 17 09:43:16 2020 +0200
+++ b/src/share/vm/gc_implementation/shenandoah/shenandoahPacer.cpp     Thu Jul 23 11:08:17 2020 +0200
@@ -216,7 +216,7 @@
   intptr_t new_val = 0;
   do {
     cur = OrderAccess::load_acquire(&_budget);
-    if (cur < tax) {
+    if (cur < tax && !force) {
       // Progress depleted, alas.
       return false;
     }

Testing: hotspot_gc_shenandoah {fastdebug,release}

-- 
Thanks,
-Aleksey



More information about the shenandoah-dev mailing list