comparison src/share/vm/gc_implementation/g1/heapRegion.cpp @ 2433:abdfc822206f

7023069: G1: Introduce symmetric locking in the slow allocation path 7023151: G1: refactor the code that operates on _cur_alloc_region to be re-used for allocs by the GC threads 7018286: G1: humongous allocation attempts should take the GC locker into account Summary: First, this change replaces the asymmetric locking scheme in the G1 slow alloc path by a summetric one. Second, it factors out the code that operates on _cur_alloc_region so that it can be re-used for allocations by the GC threads in the future. Reviewed-by: stefank, brutisso, johnc
author tonyp
date Wed, 30 Mar 2011 10:26:59 -0400
parents 0fa27f37d4d4
children 0654ee04b214 063382f9b575
comparison
equal deleted inserted replaced
2432:455328d90876 2433:abdfc822206f
358 _is_gc_alloc_region = false; 358 _is_gc_alloc_region = false;
359 359
360 set_young_index_in_cset(-1); 360 set_young_index_in_cset(-1);
361 uninstall_surv_rate_group(); 361 uninstall_surv_rate_group();
362 set_young_type(NotYoung); 362 set_young_type(NotYoung);
363 reset_pre_dummy_top();
363 364
364 if (!par) { 365 if (!par) {
365 // If this is parallel, this will be done later. 366 // If this is parallel, this will be done later.
366 HeapRegionRemSet* hrrs = rem_set(); 367 HeapRegionRemSet* hrrs = rem_set();
367 if (hrrs != NULL) hrrs->clear(); 368 if (hrrs != NULL) hrrs->clear();
921 // will pick up the right saved_mark_word() as the high water mark 922 // will pick up the right saved_mark_word() as the high water mark
922 // of the region. Either way, the behaviour will be correct. 923 // of the region. Either way, the behaviour will be correct.
923 ContiguousSpace::set_saved_mark(); 924 ContiguousSpace::set_saved_mark();
924 OrderAccess::storestore(); 925 OrderAccess::storestore();
925 _gc_time_stamp = curr_gc_time_stamp; 926 _gc_time_stamp = curr_gc_time_stamp;
926 // The following fence is to force a flush of the writes above, but 927 // No need to do another barrier to flush the writes above. If
927 // is strictly not needed because when an allocating worker thread 928 // this is called in parallel with other threads trying to
928 // calls set_saved_mark() it does so under the ParGCRareEvent_lock; 929 // allocate into the region, the caller should call this while
929 // when the lock is released, the write will be flushed. 930 // holding a lock and when the lock is released the writes will be
930 // OrderAccess::fence(); 931 // flushed.
931 } 932 }
932 } 933 }
933 934
934 G1OffsetTableContigSpace:: 935 G1OffsetTableContigSpace::
935 G1OffsetTableContigSpace(G1BlockOffsetSharedArray* sharedOffsetArray, 936 G1OffsetTableContigSpace(G1BlockOffsetSharedArray* sharedOffsetArray,