RFR (XS) 8242211: Shenandoah: remove ShenandoahHeuristics::RegionData::_seqnum_last_alloc

Aleksey Shipilev shade at redhat.com
Mon Apr 6 12:45:19 UTC 2020


RFE:
  https://bugs.openjdk.java.net/browse/JDK-8242211

This field is not needed anymore after Traversal removal, and it only wastes native memory and time
spent working through region data.

Fix:

diff -r 4d759a99c277 src/hotspot/share/gc/shenandoah/shenandoahHeuristics.cpp
--- a/src/hotspot/share/gc/shenandoah/shenandoahHeuristics.cpp  Mon Apr 06 10:31:07 2020 +0200
+++ b/src/hotspot/share/gc/shenandoah/shenandoahHeuristics.cpp  Mon Apr 06 14:43:55 2020 +0200
@@ -43,24 +43,4 @@
 }

-int ShenandoahHeuristics::compare_by_garbage_then_alloc_seq_ascending(RegionData a, RegionData b) {
-  int r = compare_by_garbage(a, b);
-  if (r != 0) {
-    return r;
-  }
-  return compare_by_alloc_seq_ascending(a, b);
-}
-
-int ShenandoahHeuristics::compare_by_alloc_seq_ascending(RegionData a, RegionData b) {
-  if (a._seqnum_last_alloc == b._seqnum_last_alloc)
-    return 0;
-  else if (a._seqnum_last_alloc < b._seqnum_last_alloc)
-    return -1;
-  else return 1;
-}
-
-int ShenandoahHeuristics::compare_by_alloc_seq_descending(RegionData a, RegionData b) {
-  return -compare_by_alloc_seq_ascending(a, b);
-}
-
 ShenandoahHeuristics::ShenandoahHeuristics() :
   _region_data(NULL),
diff -r 4d759a99c277 src/hotspot/share/gc/shenandoah/shenandoahHeuristics.hpp
--- a/src/hotspot/share/gc/shenandoah/shenandoahHeuristics.hpp  Mon Apr 06 10:31:07 2020 +0200
+++ b/src/hotspot/share/gc/shenandoah/shenandoahHeuristics.hpp  Mon Apr 06 14:43:55 2020 +0200
@@ -76,5 +76,4 @@
     ShenandoahHeapRegion* _region;
     size_t _garbage;
-    uint64_t _seqnum_last_alloc;
   } RegionData;

@@ -98,7 +97,4 @@

   static int compare_by_garbage(RegionData a, RegionData b);
-  static int compare_by_garbage_then_alloc_seq_ascending(RegionData a, RegionData b);
-  static int compare_by_alloc_seq_ascending(RegionData a, RegionData b);
-  static int compare_by_alloc_seq_descending(RegionData a, RegionData b);

   RegionData* get_region_data_cache(size_t num);

Testing: hotspot_gc_shenandoah {fastdebug,release}

-- 
Thanks,
-Aleksey




More information about the hotspot-gc-dev mailing list