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

Claes Redestad claes.redestad at oracle.com
Tue Jan 16 09:29:42 UTC 2018


looks great - both the code and the result!


filemap.cpp/hpp: could (should?) the assert-only char** top_ret param be 
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



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