mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 06:14:49 +02:00
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 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
This commit is contained in:
parent
349d820dd1
commit
3e9fe24ddd
11 changed files with 920 additions and 747 deletions
|
@ -360,6 +360,7 @@ void HeapRegion::hr_clear(bool par, bool clear_space) {
|
|||
set_young_index_in_cset(-1);
|
||||
uninstall_surv_rate_group();
|
||||
set_young_type(NotYoung);
|
||||
reset_pre_dummy_top();
|
||||
|
||||
if (!par) {
|
||||
// If this is parallel, this will be done later.
|
||||
|
@ -923,11 +924,11 @@ void G1OffsetTableContigSpace::set_saved_mark() {
|
|||
ContiguousSpace::set_saved_mark();
|
||||
OrderAccess::storestore();
|
||||
_gc_time_stamp = curr_gc_time_stamp;
|
||||
// The following fence is to force a flush of the writes above, but
|
||||
// is strictly not needed because when an allocating worker thread
|
||||
// calls set_saved_mark() it does so under the ParGCRareEvent_lock;
|
||||
// when the lock is released, the write will be flushed.
|
||||
// OrderAccess::fence();
|
||||
// No need to do another barrier to flush the writes above. If
|
||||
// this is called in parallel with other threads trying to
|
||||
// allocate into the region, the caller should call this while
|
||||
// holding a lock and when the lock is released the writes will be
|
||||
// flushed.
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue