RFR(S) 8178351 - Simplify MetaspaceShared::is_in_shared_space and MetaspaceObj::is_shared

Ioi Lam ioi.lam at oracle.com
Tue Jan 16 19:31:57 UTC 2018


Hi Claes,

Thanks for the review.

The top_ret paramater is used by non-assert code as well:

     MetaspaceObj::_shared_metaspace_top  = (void*)od_top;

so it can't be factored out.

Thanks

- Ioi


On 1/16/18 1:29 AM, Claes Redestad wrote:
> Hi,
>
> looks great - both the code and the result!
>
> Nits:
>
> filemap.cpp/hpp: could (should?) the assert-only char** top_ret param 
> be factored
> out from map_region - or guarded by DEBUG_ONLY(..)? This might mostly 
> be a style
> issue, but I'm always happier when assert-only code is called out as 
> such..
>
> metaspaceShared.cpp: simplee comparision-> simple comparison
>
> Thanks!
>
> /Claes
>
> On 2018-01-16 01:40, Ioi Lam wrote:
>> Hi,
>>
>> Please review the following simple fix for improving CDS start-up time:
>>
>> https://bugs.openjdk.java.net/browse/JDK-8178351
>> http://cr.openjdk.java.net/~iklam/jdk11/8178351-simplify-is-shared.v01/
>>
>> Since all the CDS shared metaspace regions are consecutively allocated,
>> and we can guarantee there are no gaps where the OS can allocate new
>> memory into, we can just do comparisons between 2 pointers. See
>> allocations.hpp and metaspaceShared.hpp where these methods can be
>> inlined to improve start-up time when CDS is enabled.
>>
>> For a simple HelloWorld test
>>
>>     java -Xshare:dump
>>     perf stat -r java -Xshare:on -cp . HelloWorld > /dev/null
>>
>> We see about 1% speed up on my dual-core Haswell box. As usual, YMMV.
>>
>>     BEFORE: 187,757,752 cycles, 0.048169533 sec
>>     AFTER:  185,770,302 cycles, 0.047497524 sec
>>
>> I also did some incidental code clean up.
>>
>> Testing with hs_tier{1,2,3} now.
>>
>> Thanks
>> - Ioi
>



More information about the hotspot-runtime-dev mailing list