[sh/8u] Root processing related backports

Aleksey Shipilev shade at redhat.com
Fri May 8 13:55:57 UTC 2020


On 3/17/20 5:27 PM, Zhengyu Gu wrote:
> Webrev: 
> http://cr.openjdk.java.net/~zgu/shenandoah/sh-8u-root-processing/webrev.00/

Please rebase this to the current sh/8u state? It should be simpler now that Traversal is gone.

*) cleanup_jni_refs() is dropped in shenandoahConcurrentMark.cpp here, where is it added back? I
looked at weak_roots_work(), is it in ShenandoahWeakRoots now? We have to be very accurate about
this, because we broke it already at least once :)

 501   // When we're done marking everything, we process weak references.
 502   if (_heap->process_references()) {
 503     weak_refs_work(full_gc);
 504   } else {
 505     cleanup_jni_refs();
 506   }

*) The bug mentioned here has a reproducer, please try it?
 https://mail.openjdk.java.net/pipermail/shenandoah-dev/2019-October/010952.html
 https://mail.openjdk.java.net/pipermail/shenandoah-dev/2019-October/010973.html

 310     // In JDK 8, this is handled by JNIHandles::weak_oops_do. We cannot enter here, because
 311     // it would walk the JvmtiTagMap twice (which is okay) and possibly by multiple threads
 312     // (which is not okay, because that walk is not thread-safe). In subsequent releases,
 313     // it is handled in a more straightforward manner, see JDK-8189360.
 314     /*
 315     ShenandoahForwardedIsAliveClosure is_alive;
 316     JvmtiExport::weak_oops_do(&is_alive, oops);
 317     */

*) Commented out line here:

 747 void ShenandoahConcurrentMark::weak_roots_work() {
 748 //  WorkGang* workers = _heap->workers();
 749   ShenandoahHeap* const heap = ShenandoahHeap::heap();

*) Inconsistent indenting at L137 here:

 128 class ShenandoahRootScanner : public ShenandoahRootProcessor {
 129 private:
 130   ShenandoahSerialRoots           _serial_roots;
 131   ShenandoahSystemDictionaryRoots _dict_roots;
 132   ShenandoahClassLoaderDataRoots  _cld_roots;
 133   ShenandoahThreadRoots           _thread_roots;
 134   ShenandoahWeakRoots             _weak_roots;
 135   ShenandoahStringDedupRoots      _dedup_roots;
 136   ShenandoahStringTableRoots      _string_table_roots;
 137   ShenandoahCodeCacheRoots<ITR>  _code_roots;

...and at L184 here:

 174 // Evacuate all roots at a safepoint
 175 class ShenandoahRootEvacuator : public ShenandoahRootProcessor {
 176 private:
 177   ShenandoahSerialRoots          _serial_roots;
 178   ShenandoahSystemDictionaryRoots _dict_roots;
 179   ShenandoahClassLoaderDataRoots _cld_roots;
 180   ShenandoahThreadRoots          _thread_roots;
 181   ShenandoahWeakRoots            _weak_roots;
 182   ShenandoahStringDedupRoots     _dedup_roots;
 183   ShenandoahStringTableRoots      _string_table_roots;
 184   ShenandoahCodeCacheRoots<ShenandoahCsetCodeRootsIterator> _code_roots;

...and L201 here:

 193 class ShenandoahRootUpdater : public ShenandoahRootProcessor {
 194 private:
 195   ShenandoahSerialRoots          _serial_roots;
 196   ShenandoahSystemDictionaryRoots _dict_roots;
 197   ShenandoahClassLoaderDataRoots _cld_roots;
 198   ShenandoahThreadRoots          _thread_roots;
 199   ShenandoahWeakRoots            _weak_roots;
 200   ShenandoahStringDedupRoots     _dedup_roots;
 201   ShenandoahStringTableRoots      _string_table_roots;
 202   ShenandoahCodeCacheRoots<ShenandoahCsetCodeRootsIterator> _code_roots;
 203   const bool                     _update_code_cache;

...and L219 here:

 210 // Adjuster all roots at a safepoint during full gc
 211 class ShenandoahRootAdjuster : public ShenandoahRootProcessor {
 212 private:
 213   ShenandoahSerialRoots          _serial_roots;
 214   ShenandoahSystemDictionaryRoots _dict_roots;
 215   ShenandoahClassLoaderDataRoots _cld_roots;
 216   ShenandoahThreadRoots          _thread_roots;
 217   ShenandoahWeakRoots            _weak_roots;
 218   ShenandoahStringDedupRoots     _dedup_roots;
 219   ShenandoahStringTableRoots      _string_table_roots;
 220   ShenandoahCodeCacheRoots<ShenandoahAllCodeRootsIterator> _code_roots;

*) shenandoahUtils.hpp has only the copyright header change?

*) Double new line in shenandoahRootProcessor.inline.hpp here?

  87   AlwaysTrueClosure always_true;
  88
  89
  90   _serial_roots.oops_do(oops, worker_id);

*) TestObjItrWithHeapDump.java: have you seen it run? Because I am not sure it even compiles with
these. Those are still in com.oracle.*-something in 8u, IIRC.

  36 import jdk.test.lib.process.ProcessTools;
  37 import jdk.test.lib.process.OutputAnalyzer;

-- 
Thanks,
-Aleksey



More information about the shenandoah-dev mailing list