RFR (M): 8137082: Factor out G1 prediction code from G1CollectorPolicy and clean up
Jon Masamitsu
jon.masamitsu at oracle.com
Thu Oct 1 00:02:35 UTC 2015
Thomas,
Change looks good. Couple of small points.
Good comment (magic).
466 if ((2.0 /* magic */ * _predictor.sigma()) * (double) bytes_to_copy
> (double) free_bytes) {
Make a mental note that SurvivorPadding might be a suitable
alternative magic number.
product(uintx, SurvivorPadding,
3, \
"How much buffer to keep for survivor
overflow") \
The pattern
_predictor.get_new_prediction()
appears a lot in the code. Could I tempt you into creating
a G1CollectorPolicy::get_new_prediction() to use in those
places? And I only suggest using the same name
get_new_prediction() to minimize the changes. As
opposed to some shorter name like predict() :-).
Reviewed.
Jon
On 9/24/2015 6:52 AM, Thomas Schatzl wrote:
> Hi all,
>
> can I have reviews for this cleanup change?
>
> For dynamic IHOP (JDK-8136677) I intend to make the IHOP algorithm
> mostly self-contained (and not just hack it into various places in
> G1CollectorPolicy). For that I need the prediction algorithm to be more
> self-contained to, so that the new code does not need to reference the
> whole G1CollectorPolicy.
>
> That is the reason for introducing the G1Predictions helper class that
> contains all the necessary stuff to get a "prediction" from a sequence
> of numbers without pulling in G1CollectorPolicy. Apart from that it
> showed that by factoring out the prediction code there was some unused
> code that could be deleted.
>
> Since all methods in that new G1Predictions class were/are possible to
> make const, I thought it would be a good idea to propagate that to the
> predict_XXX() methods, and move their implementations to the cpp file
> because they imo clutter up the interface a lot.
>
> So, summing it up, there is no functionality change in this CR, just
> some cleanup.
>
> CR:
> https://bugs.openjdk.java.net/browse/JDK-8137082
> Webrev:
> http://cr.openjdk.java.net/~tschatzl/8137082/webrev/
> Testing:
> jprt
>
> Thanks,
> Thomas
>
More information about the hotspot-gc-dev
mailing list