RFR(S): 8189666: Replace various inlined percentage calculations with global percent_of()

Thomas Schatzl thomas.schatzl at oracle.com
Fri Oct 20 08:32:31 UTC 2017


Hi Sangheon,

On Thu, 2017-10-19 at 12:02 -0700, sangheon.kim wrote:
> Hi Thomas,
> 
> On 10/19/2017 10:13 AM, Thomas Schatzl wrote:
> > Hi all,
> > 
> >    could I have reviews for this change that replaces some ad-hoc
> > percentage calculations by the global percent_of() method in gc
> > code?
> > 
> > CR:
> > https://bugs.openjdk.java.net/browse/JDK-8189666
> > Webrev:
> > http://cr.openjdk.java.net/~tschatzl/8189666/webrev/
> 
> Looks good as is.
> 
> These are minor nits so you can ignore.
> 1. Below lines also can be updated to use percent_of().
>      1) threadLocalAllocBuffer.cpp:278
>    double waste_percent = alloc == 0 ? 0.0 :
>                                       100.0 * waste / alloc;
> 
>      2) threadLocalAllocBuffer.cpp:419
>    double waste_percent = _total_allocation == 0 ? 0.0 :
>                           100.0 * waste / _total_allocation;
> 
> 2. Copyright needs to be updated for below files:
>      - g1IHOPControl.cpp
>      - g1StringDedupStat.cpp
>      - g1StringDedupTable.cpp
> 

  all fixed. Also found some more percent calculations while widening
my search in metaspace code.

webrev:
http://cr.openjdk.java.net/~tschatzl/8189666/webrev.1 (full)
http://cr.openjdk.java.net/~tschatzl/8189666/webrev.0_to_1 (diff)

Testing:
local build

Thomas



More information about the hotspot-gc-dev mailing list