RFR(S) JDK-8025526: VirtualSpace should support per-instance disabling of large pages
Mikael Gerdin
mikael.gerdin at oracle.com
Fri Oct 4 11:28:44 UTC 2013
On 10/04/2013 01:24 PM, Stefan Karlsson wrote:
> On 2013-10-02 12:23, Erik Helin wrote:
>> On 2013-09-30, Mikael Gerdin wrote:
>>> Erik,
>>>
>>> On 09/27/2013 05:10 PM, Erik Helin wrote:
>>>> Hi Mikael,
>>>>
>>>> what do you think about splitting the VirtualSpace::initialize method
>>>> into two methods:
>>>> - VirtualSpace::initialize
>>>> - VirtualSpace::initialize_with_granularity
>>>>
>>>> Then initialize would just call initialize_with_granularity like the
>>>> following:
>>>>
>>>> bool VirtualSpace::initialize(ReservedSpace rs, size_t
>>>> committed_size) {
>>>> size_t granularity = os::page_size_for_regions(rs.size(),
>>>> rs.size(), 1);
>>>> return initialize_with_granularity(rs, committed_size,
>>>> granularity);
>>>> }
>>>>
>>>> bool VirtualSpace::initialize_with_granularity(ReservedSpace rs,
>>>> size_t committed_size, size_t granularity) {
>>>> assert(granularity > 0, "Can't have 0 as granularity");
>>>> // old initialize code
>>>> _middle_alignment = granularity;
>>>> // rest of old initialized code
>>>> }
>>>>
>>>> This way, we get rid of the default argument and don't have to check if
>>>> max_commit_granularity == 0.
>>> I like your suggestion.
>>> I've uploaded a second webrev which implements your suggestion.
>>> I had to update the test code so I re-ran the tests on all platforms.
>>>
>>> New webrev: http://cr.openjdk.java.net/~mgerdin/8025526/webrev.1/
>> Besides from Thomas' comment about the default value for the method
>> parameter, this looks good! Thanks for also adding tests!
>
> Yes. Looks good.
Thanks, Stefan!
/Mikael
>
> thanks,
> StefanK
>
>>
>> Erik
>>
>>> /Mikael
>>>
>>>> Thanks,
>>>> Erik
>>>>
>>>> On 2013-09-27, Mikael Gerdin wrote:
>>>>> Hi,
>>>>>
>>>>> As part of ongoing work in getting Metaspace to properly enforce the
>>>>> MaxMetaspaceSize limit [JDK-8024547] we need to extend the
>>>>> VirtualSpace class to allow us to set the granularity at which
>>>>> VirtualSpace commits pages from the OS.
>>>>>
>>>>> Summary of changes:
>>>>> Extend VirtualSpace::initialize to take a parameter for setting the
>>>>> maximum commit granularity. The default value 0 keeps the previous
>>>>> behavior of using os::page_size_for_region to determine the
>>>>> granularity.
>>>>> Add unit tests for disabling and enabling large pages both at the
>>>>> ReservedSpace and the VirtualSpace level.
>>>>>
>>>>> Testing:
>>>>> JPRT run (includes running the new tests)
>>>>>
>>>>> Webrev: http://cr.openjdk.java.net/~mgerdin/8025526/webrev.0
>>>>> Bug link: https://bugs.openjdk.java.net/browse/JDK-8025526
>>>>>
>>>>> /Mikael
>
More information about the hotspot-gc-dev
mailing list