RFR: 8066875: VirtualSpace does not use large pages

Erik Helin erik.helin at oracle.com
Tue Dec 9 19:35:51 UTC 2014


Hi all,

the fix for JDK-8049864 [0] made os::page_size_for_region slightly more 
strict since the function now demands that the given region_size is size 
aligned with respect to the chosen page_size. The reason for doing this 
was that os::page_size_for_region was used in two ways:
1. Give me a suitable page size for this amount of memory
2. Give me the largest page size for this amount of memory
The fix for JDK-8049864 fixed os::page_size_for_region for the "suitable 
page size" scenario, but is too strict for the "largest page size" 
scenario. This caused a regression in VirtualSpace::initialize, which 
only needs the largest possible page size, since 
VirtualSpace::initialize_with_granularity takes care of any alignment 
issues.

This patch adds the function os::largest_page_size_less_than and updates 
VirtualSpace::initialize to use this new function instead of 
os::page_size_for_region.

Webrev:
http://cr.openjdk.java.net/~ehelin/8066875/webrev.00/

Bug:
https://bugs.openjdk.java.net/browse/JDK-8066875

Testing:
- JPRT
- Verified that the code cache now uses large pages even if
   ReservedCodeCacheSize is 241 MB (see bug for more details).
- Added new internal vm tests (also run on SPARC machine with large
   pages)

Thanks,
Erik

[0]: http://hg.openjdk.java.net/jdk9/hs-gc/hotspot/rev/b326a3e8dcab


More information about the hotspot-dev mailing list