src/share/vm/gc_implementation/parallelScavenge/psPromotionLAB.cpp

changeset 1
2d8a650513c2
parent 0
f90c822e73f8
child 25
873fd82b133d
     1.1 --- a/src/share/vm/gc_implementation/parallelScavenge/psPromotionLAB.cpp	Wed Apr 27 01:25:04 2016 +0800
     1.2 +++ b/src/share/vm/gc_implementation/parallelScavenge/psPromotionLAB.cpp	Fri Apr 29 00:06:10 2016 +0800
     1.3 @@ -22,10 +22,17 @@
     1.4   *
     1.5   */
     1.6  
     1.7 +/*
     1.8 + * This file has been modified by Loongson Technology in 2015. These
     1.9 + * modifications are Copyright (c) 2015 Loongson Technology, and are made
    1.10 + * available on the same license terms set forth above.
    1.11 + */
    1.12 +
    1.13  #include "precompiled.hpp"
    1.14  #include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp"
    1.15  #include "gc_implementation/parallelScavenge/psPromotionLAB.hpp"
    1.16  #include "gc_implementation/shared/mutableSpace.hpp"
    1.17 +#include "gc_implementation/shared/mutableNUMASpace.hpp"
    1.18  #include "oops/oop.inline.hpp"
    1.19  
    1.20  size_t PSPromotionLAB::filler_header_size;
    1.21 @@ -157,8 +164,28 @@
    1.22    PSOldGen* old_gen = heap->old_gen();
    1.23    MemRegion used = old_gen->object_space()->used_region();
    1.24  
    1.25 -  if (used.contains(lab)) {
    1.26 -    return true;
    1.27 +  /* 2014/2/12/ Liao: In UseOldNUMA, the new lab may be allocated out of the current used_region. 
    1.28 +   * For example, a new plab should be allocated in lgrp2, while the top of current used_region 
    1.29 +   * is in lgrp1. The original checking will return invalid, while this situation is reasonable. 
    1.30 +   * So we should check whether the lab is in one of the lgrps. */
    1.31 +  if(UseOldNUMA) {
    1.32 +    MutableSpace* sp;
    1.33 +    MutableNUMASpace::LGRPSpace *ls;
    1.34 +    MutableNUMASpace* s = (MutableNUMASpace*) old_gen->object_space();
    1.35 +    int i, j;
    1.36 +    i = s->lgrp_spaces()->length();
    1.37 +    for(j = 0; j < i; j++) {
    1.38 +      ls = s->lgrp_spaces()->at(j);
    1.39 +      sp = ls->space();
    1.40 +      used = sp ->used_region(); 
    1.41 +      if (used.contains(lab)) 
    1.42 +        return true;
    1.43 +    }
    1.44 +  }
    1.45 +  else {
    1.46 +    if (used.contains(lab)) {
    1.47 +      return true;
    1.48 +    }
    1.49    }
    1.50  
    1.51    return false;

mercurial