RFR: 8071462: Remove G1ParGCAllocator::alloc_buffer_waste

Michail Chernov michail.chernov at oracle.com
Fri Apr 17 11:23:31 UTC 2015


Hi Thomas,

Thanks for looking!

On 17.04.2015 14:08, Thomas Schatzl wrote:
> Hi Michail,
>
> On Wed, 2015-04-15 at 21:42 +0300, Michail Chernov wrote:
>> Hi Thomas,
>>
>> I tried to make all what you said.
>> Webrev: http://cr.openjdk.java.net/~dpochepk/~mchernov/8071462/webrev.02/
>>
>> ParGCAllocBuffer::add_undo_waste and
>> ParGCAllocBuffer::undo_last_allocation were made as protected members.
>>
>> ParGCAllocBuffer::undo_allocation now does the same as
>> ParScanThreadState::undo_alloc_in_to_space and
>> G1ParGCAllocator::undo_allocation
>>
>> G1ParGCAllocator has virtual G1PLABWasteStat wasted() = 0; method which
>> must be implemented in all heirs.
>>
>> Introduced new class G1PLABWasteStat (g1Allocator.hpp) that retrieves
>> wasted and undo wasted values from allocation buffers. If new class is
>> not acceptable there, I can add 2 virtual methods to G1ParGCAllocator
>> for retrieving wasted and undo wasted values.
>    some comments:
>
> - Introduction of G1PLABWasteStat fine with me, although I would not add
> an extra type just for two values to be returned.
Should I create 2 separate virtual method to get wasted and undo wasted 
values? Or I can use Pair template which is from utilities/pair.hpp.
> - I would prefer to use a noun in the method that returns the
> statistics, i.e. waste() instead of wasted(). This can be ignored if you
> prefer it the other way.
>
> - in parGCAllocBuffer.cpp:105 there is an extra comma in
> PLABStats::adjust_desired_plab_sz()
These will be fixed.
> Otherwise looks good.
>
> Thomas
>
Thanks,
Michail


More information about the hotspot-gc-dev mailing list