JDK-8270842 : G1: Only young regions need to redirty outside references in remset.
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 18
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2021-07-16
  • Updated: 2021-11-15
  • Resolved: 2021-08-06
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 18
18 b10Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
For evac failure objects in non-young regions (old) of cset, the outside reference remset already recorded in the dirty queue, we only needs to do it for obj in young regions

diff --git a/src/hotspot/share/gc/g1/g1EvacFailure.cpp b/src/hotspot/share/gc/g1/g1EvacFailure.cpp
index 07a4603ade0..1f775badbac 100644
--- a/src/hotspot/share/gc/g1/g1EvacFailure.cpp
+++ b/src/hotspot/share/gc/g1/g1EvacFailure.cpp
@@ -80,6 +80,7 @@ class RemoveSelfForwardPtrObjClosure: public ObjectClosure {
   G1CollectedHeap* _g1h;
   G1ConcurrentMark* _cm;
   HeapRegion* _hr;
+  const bool _is_young;
   size_t _marked_bytes;
   UpdateLogBuffersDeferred* _log_buffer_cl;
   bool _during_concurrent_start;
@@ -94,6 +95,7 @@ public:
     _g1h(G1CollectedHeap::heap()),
     _cm(_g1h->concurrent_mark()),
     _hr(hr),
+    _is_young(hr->is_young()),
     _marked_bytes(0),
     _log_buffer_cl(log_buffer_cl),
     _during_concurrent_start(during_concurrent_start),
@@ -152,7 +154,9 @@ public:
       // The problem is that, if evacuation fails, we might have
       // remembered set entries missing given that we skipped cards on
       // the collection set. So, we'll recreate such entries now.
-      obj->oop_iterate(_log_buffer_cl);
+      if (_is_young) {
+        obj->oop_iterate(_log_buffer_cl);
+      }
 
       HeapWord* obj_end = obj_addr + obj_size;
       _last_forwarded_object_end = obj_end;

Comments
Changeset: cc615208 Author: Hamlin Li <mli@openjdk.org> Date: 2021-08-06 14:16:11 +0000 URL: https://git.openjdk.java.net/jdk/commit/cc61520803513e5aab597322303145562948c9a6
06-08-2021