RFR(S): 8189666: Replace various inlined percentage calculations with global percent_of()
Stefan Johansson
stefan.johansson at oracle.com
Fri Oct 20 09:24:10 UTC 2017
Hi Thomas,
On 2017-10-20 10:32, Thomas Schatzl wrote:
> 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)
Thanks for cleaning this up Thomas, one minor thing that you can skip if
you don't agree.
src/hotspot/share/gc/g1/g1DefaultPolicy.hpp:
- Rename reclaimable_bytes_perc to reclaimable_bytes_percent.
Thanks,
Stefan
> Testing:
> local build
>
> Thomas
More information about the hotspot-gc-dev
mailing list