RFR (S): 8067341: Modify PLAB sizing algorithm to waste less
thomas.schatzl at oracle.com
Wed Aug 26 09:54:57 UTC 2015
Hi Jon (and Eric),
thanks for your reviews.
On Tue, 2015-08-25 at 16:09 -0700, Jon Masamitsu wrote:
> 85 experimental(size_t, G1ExpectedAveragePLABOccupancyPercent, 50, \
> 86 "Expected average occupancy of PLABs after GC in percent.") \
> 87 range(0, 100) \
> Range should be (1, 100) since you divide by
> in the calculations?
Okay, good catch. I introduced that variable very late.
> 77 size_t const waste_used_for_calculation = used() > _region_end_waste ? used() - _region_end_waste : 0;
> "waste_used_for_calculation" is a measure of "used" during the GC
> so maybe a better name would be "used_for_waste_calculation" or
> When _region_end_waste is high, waste_used_for_calculation under
> estimates the
> amount used so under estimates the amount of waste (since the waste
> is a percentage of waste_used_for_calculation ) and so lowers the size
> of the next PLAB. I can see that it scales reasonably.
> Why G1ExpectedAveragePLABOccupancyPercent that can be different than 50?
> If it is so that the user can scale the PLAB's up or down, what about
That is the intent.
> scale factor called G1PLABPercent?
That name seems to me a bit too unspecific, I chose
G1PLABOccupancyFactor for this revision. Feel free to comment on this.
> 80 size_t const total_waste_allowed = waste_used_for_calculation * (TargetPLABWastePct / 100);
> 81 size_t const cur_plab_sz = total_waste_allowed * (G1PLABPercent / 100)
> G1PLABPercent would be easier to explain. It's effect would be linear
> with its
> value (as opposed to inversely proportional) and is a shorter name :-).
In that case to me a simple scale factor seems more appropriate - I
created a new webrev to look at:
I also tried to improve the documentation.
More information about the hotspot-gc-dev