RFR (sh/jdk): Fix evac-lock shift

Roman Kennke rkennke at redhat.com
Mon Jun 29 12:05:54 UTC 2020


I made a mistake in computing the evac-lock-shift. I wrongly assumed
that pointer_delta(a, b) gives me the byte-difference between b and a,
but it really gives the pointer different in units of the type of a and
b. (Why is it not ok to use C++ pointer math there?!) This makes
calculation of the _shifter wrong. Fix:

http://cr.openjdk.java.net/~rkennke/fix-evac-lock-shift/webrev.00/



@@ -52,11 +52,11 @@
   inline size_t addr_to_offset(const HeapWord* addr) const;
 
 public:
   ShenandoahEvacLockingBitmap(MemRegion heap) :
   _covered(heap),
-  _shifter((1 + ShenandoahEvacLockGranularity) * LogHeapWordSize),
+  _shifter(ShenandoahEvacLockGranularity),
   _bm(_covered.word_size() >> _shifter, mtGC) {
 }
 
   inline void acquire(oop obj);
   inline void release(oop obj);


Testing: hotspot_gc_shenandoah, specjvm with higher-than-10 values of
ShenandoahEvacLockGranularity (which crashed before).

Good?

Roman



More information about the shenandoah-dev mailing list