Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8270841

G1: No need to check "in cset" in PSS::do_oop_evac

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Not an Issue
    • Icon: P4 P4
    • None
    • 18
    • hotspot
    • gc

      It seems to me that the comments and check does not make sense any more, or I missed something?

      diff --git a/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp b/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp
      index 9eebe411936..b90d18f8bb2 100644
      --- a/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp
      +++ b/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp
      @@ -178,11 +178,6 @@ void G1ParScanThreadState::do_oop_evac(T* p) {
         // Reference should not be NULL here as such are never pushed to the task queue.
         oop obj = RawAccess<IS_NOT_NULL>::oop_load(p);
       
      - // Although we never intentionally push references outside of the collection
      - // set, due to (benign) races in the claim mechanism during RSet scanning more
      - // than one thread might claim the same card. So the same card may be
      - // processed multiple times, and so we might get references into old gen here.
      - // So we need to redo this check.
         const G1HeapRegionAttr region_attr = _g1h->region_attr(obj);
         // References pushed onto the work stack should never point to a humongous region
         // as they are not added to the collection set due to above precondition.
      @@ -190,10 +185,7 @@ void G1ParScanThreadState::do_oop_evac(T* p) {
                "Obj " PTR_FORMAT " should not refer to humongous region %u from " PTR_FORMAT,
                p2i(obj), _g1h->addr_to_region(cast_from_oop<HeapWord*>(obj)), p2i(p));
       
      - if (!region_attr.is_in_cset()) {
      - // In this case somebody else already did all the work.
      - return;
      - }
      + assert(region_attr.is_in_cset(), "Must be!");
       
         markWord m = obj->mark();
         if (m.is_marked()) {

            mli Hamlin Li
            mli Hamlin Li
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: