mirror of
https://github.com/openjdk/jdk.git
synced 2026-02-12 11:28:35 +00:00
8078193: BACKOUT: Rename and clean up the ParGCAllocBuffer class
Back out the problem change set. Reviewed-by: brutisso, tschatzl
This commit is contained in:
parent
e4a699552a
commit
9d2e807891
@ -110,15 +110,15 @@ void G1DefaultAllocator::abandon_gc_alloc_regions() {
|
||||
_retained_old_gc_alloc_region = NULL;
|
||||
}
|
||||
|
||||
G1PLAB::G1PLAB(size_t gclab_word_size) :
|
||||
PLAB(gclab_word_size), _retired(true) { }
|
||||
G1ParGCAllocBuffer::G1ParGCAllocBuffer(size_t gclab_word_size) :
|
||||
ParGCAllocBuffer(gclab_word_size), _retired(true) { }
|
||||
|
||||
HeapWord* G1ParGCAllocator::allocate_direct_or_new_plab(InCSetState dest,
|
||||
size_t word_sz,
|
||||
AllocationContext_t context) {
|
||||
size_t gclab_word_size = _g1h->desired_plab_sz(dest);
|
||||
if (word_sz * 100 < gclab_word_size * ParallelGCBufferWastePct) {
|
||||
G1PLAB* alloc_buf = alloc_buffer(dest, context);
|
||||
G1ParGCAllocBuffer* alloc_buf = alloc_buffer(dest, context);
|
||||
add_to_alloc_buffer_waste(alloc_buf->words_remaining());
|
||||
alloc_buf->retire();
|
||||
|
||||
@ -151,7 +151,7 @@ G1DefaultParGCAllocator::G1DefaultParGCAllocator(G1CollectedHeap* g1h) :
|
||||
|
||||
void G1DefaultParGCAllocator::retire_alloc_buffers() {
|
||||
for (uint state = 0; state < InCSetState::Num; state++) {
|
||||
G1PLAB* const buf = _alloc_buffers[state];
|
||||
G1ParGCAllocBuffer* const buf = _alloc_buffers[state];
|
||||
if (buf != NULL) {
|
||||
add_to_alloc_buffer_waste(buf->words_remaining());
|
||||
buf->flush_and_retire_stats(_g1h->alloc_buffer_stats(state));
|
||||
|
||||
@ -28,7 +28,7 @@
|
||||
#include "gc_implementation/g1/g1AllocationContext.hpp"
|
||||
#include "gc_implementation/g1/g1AllocRegion.hpp"
|
||||
#include "gc_implementation/g1/g1InCSetState.hpp"
|
||||
#include "gc_implementation/shared/plab.hpp"
|
||||
#include "gc_implementation/shared/parGCAllocBuffer.hpp"
|
||||
#include "gc_interface/collectedHeap.hpp"
|
||||
|
||||
class EvacuationInfo;
|
||||
@ -147,18 +147,18 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class G1PLAB: public PLAB {
|
||||
class G1ParGCAllocBuffer: public ParGCAllocBuffer {
|
||||
private:
|
||||
bool _retired;
|
||||
|
||||
public:
|
||||
G1PLAB(size_t gclab_word_size);
|
||||
virtual ~G1PLAB() {
|
||||
G1ParGCAllocBuffer(size_t gclab_word_size);
|
||||
virtual ~G1ParGCAllocBuffer() {
|
||||
guarantee(_retired, "Allocation buffer has not been retired");
|
||||
}
|
||||
|
||||
virtual void set_buf(HeapWord* buf) {
|
||||
PLAB::set_buf(buf);
|
||||
ParGCAllocBuffer::set_buf(buf);
|
||||
_retired = false;
|
||||
}
|
||||
|
||||
@ -166,7 +166,7 @@ public:
|
||||
if (_retired) {
|
||||
return;
|
||||
}
|
||||
PLAB::retire();
|
||||
ParGCAllocBuffer::retire();
|
||||
_retired = true;
|
||||
}
|
||||
};
|
||||
@ -190,7 +190,7 @@ protected:
|
||||
void add_to_undo_waste(size_t waste) { _undo_waste += waste; }
|
||||
|
||||
virtual void retire_alloc_buffers() = 0;
|
||||
virtual G1PLAB* alloc_buffer(InCSetState dest, AllocationContext_t context) = 0;
|
||||
virtual G1ParGCAllocBuffer* alloc_buffer(InCSetState dest, AllocationContext_t context) = 0;
|
||||
|
||||
// Calculate the survivor space object alignment in bytes. Returns that or 0 if
|
||||
// there are no restrictions on survivor alignment.
|
||||
@ -229,7 +229,7 @@ public:
|
||||
HeapWord* plab_allocate(InCSetState dest,
|
||||
size_t word_sz,
|
||||
AllocationContext_t context) {
|
||||
G1PLAB* buffer = alloc_buffer(dest, context);
|
||||
G1ParGCAllocBuffer* buffer = alloc_buffer(dest, context);
|
||||
if (_survivor_alignment_bytes == 0) {
|
||||
return buffer->allocate(word_sz);
|
||||
} else {
|
||||
@ -259,14 +259,14 @@ public:
|
||||
};
|
||||
|
||||
class G1DefaultParGCAllocator : public G1ParGCAllocator {
|
||||
G1PLAB _surviving_alloc_buffer;
|
||||
G1PLAB _tenured_alloc_buffer;
|
||||
G1PLAB* _alloc_buffers[InCSetState::Num];
|
||||
G1ParGCAllocBuffer _surviving_alloc_buffer;
|
||||
G1ParGCAllocBuffer _tenured_alloc_buffer;
|
||||
G1ParGCAllocBuffer* _alloc_buffers[InCSetState::Num];
|
||||
|
||||
public:
|
||||
G1DefaultParGCAllocator(G1CollectedHeap* g1h);
|
||||
|
||||
virtual G1PLAB* alloc_buffer(InCSetState dest, AllocationContext_t context) {
|
||||
virtual G1ParGCAllocBuffer* alloc_buffer(InCSetState dest, AllocationContext_t context) {
|
||||
assert(dest.is_valid(),
|
||||
err_msg("Allocation buffer index out-of-bounds: " CSETSTATE_FORMAT, dest.value()));
|
||||
assert(_alloc_buffers[dest.value()] != NULL,
|
||||
|
||||
@ -39,6 +39,7 @@
|
||||
#include "gc_implementation/g1/heapRegionManager.hpp"
|
||||
#include "gc_implementation/g1/heapRegionSet.hpp"
|
||||
#include "gc_implementation/shared/hSpaceCounters.hpp"
|
||||
#include "gc_implementation/shared/parGCAllocBuffer.hpp"
|
||||
#include "gc_interface/collectedHeap.hpp"
|
||||
#include "memory/barrierSet.hpp"
|
||||
#include "memory/memRegion.hpp"
|
||||
|
||||
@ -34,7 +34,7 @@
|
||||
#include "gc_implementation/shared/gcTimer.hpp"
|
||||
#include "gc_implementation/shared/gcTrace.hpp"
|
||||
#include "gc_implementation/shared/gcTraceTime.hpp"
|
||||
#include "gc_implementation/shared/plab.inline.hpp"
|
||||
#include "gc_implementation/shared/parGCAllocBuffer.inline.hpp"
|
||||
#include "gc_implementation/shared/spaceDecorator.hpp"
|
||||
#include "memory/defNewGeneration.inline.hpp"
|
||||
#include "memory/genCollectedHeap.hpp"
|
||||
@ -226,7 +226,7 @@ HeapWord* ParScanThreadState::alloc_in_to_space_slow(size_t word_sz) {
|
||||
// buffer.
|
||||
HeapWord* obj = NULL;
|
||||
if (!_to_space_full) {
|
||||
PLAB* const plab = to_space_alloc_buffer();
|
||||
ParGCAllocBuffer* const plab = to_space_alloc_buffer();
|
||||
Space* const sp = to_space();
|
||||
if (word_sz * 100 <
|
||||
ParallelGCBufferWastePct * plab->word_sz()) {
|
||||
@ -236,7 +236,7 @@ HeapWord* ParScanThreadState::alloc_in_to_space_slow(size_t word_sz) {
|
||||
HeapWord* buf_space = sp->par_allocate(buf_size);
|
||||
if (buf_space == NULL) {
|
||||
const size_t min_bytes =
|
||||
PLAB::min_size() << LogHeapWordSize;
|
||||
ParGCAllocBuffer::min_size() << LogHeapWordSize;
|
||||
size_t free_bytes = sp->free();
|
||||
while(buf_space == NULL && free_bytes >= min_bytes) {
|
||||
buf_size = free_bytes >> LogHeapWordSize;
|
||||
@ -252,7 +252,7 @@ HeapWord* ParScanThreadState::alloc_in_to_space_slow(size_t word_sz) {
|
||||
record_survivor_plab(buf_space, buf_size);
|
||||
obj = plab->allocate_aligned(word_sz, SurvivorAlignmentInBytes);
|
||||
// Note that we cannot compare buf_size < word_sz below
|
||||
// because of AlignmentReserve (see PLAB::allocate()).
|
||||
// because of AlignmentReserve (see ParGCAllocBuffer::allocate()).
|
||||
assert(obj != NULL || plab->words_remaining() < word_sz,
|
||||
"Else should have been able to allocate");
|
||||
// It's conceivable that we may be able to use the
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
|
||||
#include "gc_implementation/parNew/parOopClosures.hpp"
|
||||
#include "gc_implementation/shared/gcTrace.hpp"
|
||||
#include "gc_implementation/shared/plab.hpp"
|
||||
#include "gc_implementation/shared/parGCAllocBuffer.hpp"
|
||||
#include "gc_implementation/shared/copyFailedInfo.hpp"
|
||||
#include "memory/defNewGeneration.hpp"
|
||||
#include "memory/padded.hpp"
|
||||
@ -65,7 +65,7 @@ class ParScanThreadState {
|
||||
ObjToScanQueue *_work_queue;
|
||||
Stack<oop, mtGC>* const _overflow_stack;
|
||||
|
||||
PLAB _to_space_alloc_buffer;
|
||||
ParGCAllocBuffer _to_space_alloc_buffer;
|
||||
|
||||
ParScanWithoutBarrierClosure _to_space_closure; // scan_without_gc_barrier
|
||||
ParScanWithBarrierClosure _old_gen_closure; // scan_with_gc_barrier
|
||||
@ -140,7 +140,7 @@ class ParScanThreadState {
|
||||
|
||||
ObjToScanQueue* work_queue() { return _work_queue; }
|
||||
|
||||
PLAB* to_space_alloc_buffer() {
|
||||
ParGCAllocBuffer* to_space_alloc_buffer() {
|
||||
return &_to_space_alloc_buffer;
|
||||
}
|
||||
|
||||
|
||||
@ -23,21 +23,21 @@
|
||||
*/
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#include "gc_implementation/shared/plab.hpp"
|
||||
#include "gc_implementation/shared/parGCAllocBuffer.hpp"
|
||||
#include "memory/threadLocalAllocBuffer.hpp"
|
||||
#include "oops/arrayOop.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
|
||||
size_t PLAB::min_size() {
|
||||
size_t ParGCAllocBuffer::min_size() {
|
||||
// Make sure that we return something that is larger than AlignmentReserve
|
||||
return align_object_size(MAX2(MinTLABSize / HeapWordSize, (uintx)oopDesc::header_size())) + AlignmentReserve;
|
||||
}
|
||||
|
||||
size_t PLAB::max_size() {
|
||||
size_t ParGCAllocBuffer::max_size() {
|
||||
return ThreadLocalAllocBuffer::max_size();
|
||||
}
|
||||
|
||||
PLAB::PLAB(size_t desired_plab_sz_) :
|
||||
ParGCAllocBuffer::ParGCAllocBuffer(size_t desired_plab_sz_) :
|
||||
_word_sz(desired_plab_sz_), _bottom(NULL), _top(NULL),
|
||||
_end(NULL), _hard_end(NULL), _allocated(0), _wasted(0)
|
||||
{
|
||||
@ -53,9 +53,9 @@ PLAB::PLAB(size_t desired_plab_sz_) :
|
||||
// the smallest object. We can't allow that because the buffer must
|
||||
// look like it's full of objects when we retire it, so we make
|
||||
// sure we have enough space for a filler int array object.
|
||||
size_t PLAB::AlignmentReserve;
|
||||
size_t ParGCAllocBuffer::AlignmentReserve;
|
||||
|
||||
void PLAB::flush_and_retire_stats(PLABStats* stats) {
|
||||
void ParGCAllocBuffer::flush_and_retire_stats(PLABStats* stats) {
|
||||
// Retire the last allocation buffer.
|
||||
size_t unused = retire_internal();
|
||||
|
||||
@ -71,11 +71,11 @@ void PLAB::flush_and_retire_stats(PLABStats* stats) {
|
||||
_wasted = 0;
|
||||
}
|
||||
|
||||
void PLAB::retire() {
|
||||
void ParGCAllocBuffer::retire() {
|
||||
_wasted += retire_internal();
|
||||
}
|
||||
|
||||
size_t PLAB::retire_internal() {
|
||||
size_t ParGCAllocBuffer::retire_internal() {
|
||||
size_t result = 0;
|
||||
if (_top < _hard_end) {
|
||||
CollectedHeap::fill_with_object(_top, _hard_end);
|
||||
@ -126,8 +126,8 @@ void PLABStats::adjust_desired_plab_sz(uint no_of_gc_workers) {
|
||||
}
|
||||
|
||||
#ifndef PRODUCT
|
||||
void PLAB::print() {
|
||||
gclog_or_tty->print_cr("PLAB: _bottom: " PTR_FORMAT " _top: " PTR_FORMAT
|
||||
void ParGCAllocBuffer::print() {
|
||||
gclog_or_tty->print_cr("parGCAllocBuffer: _bottom: " PTR_FORMAT " _top: " PTR_FORMAT
|
||||
" _end: " PTR_FORMAT " _hard_end: " PTR_FORMAT ")",
|
||||
p2i(_bottom), p2i(_top), p2i(_end), p2i(_hard_end));
|
||||
}
|
||||
@ -22,8 +22,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_PLAB_HPP
|
||||
#define SHARE_VM_GC_IMPLEMENTATION_SHARED_PLAB_HPP
|
||||
#ifndef SHARE_VM_GC_IMPLEMENTATION_PARNEW_PARGCALLOCBUFFER_HPP
|
||||
#define SHARE_VM_GC_IMPLEMENTATION_PARNEW_PARGCALLOCBUFFER_HPP
|
||||
|
||||
#include "gc_implementation/shared/gcUtil.hpp"
|
||||
#include "memory/allocation.hpp"
|
||||
@ -34,7 +34,7 @@
|
||||
class PLABStats;
|
||||
|
||||
// A per-thread allocation buffer used during GC.
|
||||
class PLAB: public CHeapObj<mtGC> {
|
||||
class ParGCAllocBuffer: public CHeapObj<mtGC> {
|
||||
protected:
|
||||
char head[32];
|
||||
size_t _word_sz; // In HeapWord units
|
||||
@ -65,8 +65,8 @@ protected:
|
||||
public:
|
||||
// Initializes the buffer to be empty, but with the given "word_sz".
|
||||
// Must get initialized with "set_buf" for an allocation to succeed.
|
||||
PLAB(size_t word_sz);
|
||||
virtual ~PLAB() {}
|
||||
ParGCAllocBuffer(size_t word_sz);
|
||||
virtual ~ParGCAllocBuffer() {}
|
||||
|
||||
// Minimum PLAB size.
|
||||
static size_t min_size();
|
||||
@ -166,11 +166,11 @@ class PLABStats VALUE_OBJ_CLASS_SPEC {
|
||||
{ }
|
||||
|
||||
static const size_t min_size() {
|
||||
return PLAB::min_size();
|
||||
return ParGCAllocBuffer::min_size();
|
||||
}
|
||||
|
||||
static const size_t max_size() {
|
||||
return PLAB::max_size();
|
||||
return ParGCAllocBuffer::max_size();
|
||||
}
|
||||
|
||||
size_t desired_plab_sz() {
|
||||
@ -194,4 +194,4 @@ class PLABStats VALUE_OBJ_CLASS_SPEC {
|
||||
}
|
||||
};
|
||||
|
||||
#endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_PLAB_HPP
|
||||
#endif // SHARE_VM_GC_IMPLEMENTATION_PARNEW_PARGCALLOCBUFFER_HPP
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -22,13 +22,13 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_PLAB_INLINE_HPP
|
||||
#define SHARE_VM_GC_IMPLEMENTATION_SHARED_PLAB_INLINE_HPP
|
||||
#ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_PARGCALLOCBUFFER_INLINE_HPP
|
||||
#define SHARE_VM_GC_IMPLEMENTATION_SHARED_PARGCALLOCBUFFER_INLINE_HPP
|
||||
|
||||
#include "gc_implementation/shared/plab.hpp"
|
||||
#include "gc_implementation/shared/parGCAllocBuffer.hpp"
|
||||
#include "gc_interface/collectedHeap.inline.hpp"
|
||||
|
||||
HeapWord* PLAB::allocate_aligned(size_t word_sz, unsigned short alignment_in_bytes) {
|
||||
HeapWord* ParGCAllocBuffer::allocate_aligned(size_t word_sz, unsigned short alignment_in_bytes) {
|
||||
|
||||
HeapWord* res = CollectedHeap::align_allocation_or_fail(_top, _end, alignment_in_bytes);
|
||||
if (res == NULL) {
|
||||
@ -41,4 +41,4 @@ HeapWord* PLAB::allocate_aligned(size_t word_sz, unsigned short alignment_in_byt
|
||||
return allocate(word_sz);
|
||||
}
|
||||
|
||||
#endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_PLAB_INLINE_HPP
|
||||
#endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_PARGCALLOCBUFFER_INLINE_HPP
|
||||
@ -315,7 +315,7 @@
|
||||
# include "gc_implementation/parallelScavenge/psYoungGen.hpp"
|
||||
# include "gc_implementation/shared/gcAdaptivePolicyCounters.hpp"
|
||||
# include "gc_implementation/shared/gcPolicyCounters.hpp"
|
||||
# include "gc_implementation/shared/plab.hpp"
|
||||
# include "gc_implementation/shared/parGCAllocBuffer.hpp"
|
||||
#endif // INCLUDE_ALL_GCS
|
||||
|
||||
#endif // !DONT_USE_PRECOMPILED_HEADER
|
||||
|
||||
@ -1960,7 +1960,7 @@ class CommandLineFlags {
|
||||
"collection") \
|
||||
\
|
||||
develop(uintx, PromotionFailureALotCount, 1000, \
|
||||
"Number of promotion failures occurring at PLAB " \
|
||||
"Number of promotion failures occurring at ParGCAllocBuffer " \
|
||||
"refill attempts (ParNew) or promotion attempts " \
|
||||
"(other young collectors)") \
|
||||
\
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user