RFR: 8224820: ZGC: Support discontiguous heap reservations

erik.osterlund at oracle.com erik.osterlund at oracle.com
Tue Sep 24 11:28:26 UTC 2019


Hi Stefan,

Thanks for the review.

/Erik

On 09/24/2019 10:19 AM, Stefan Karlsson wrote:
> Looks good.
>
> StefanK
>
> On 2019-09-17 12:05, Per Liden wrote:
>> Hi,
>>
>> Discussed with Erik off-line. In light of things like future Windows 
>> support, we probably don't want to make the reservation code shared, 
>> instead just move it to os/posix.
>>
>> Here's a proposed webrev for doing just that:
>>
>> http://cr.openjdk.java.net/~pliden/8224820/webrev.0
>>
>> /Per
>>
>> On 9/5/19 3:51 PM, Per Liden wrote:
>>> On 8/9/19 11:59 AM, Erik Österlund wrote:
>>>> Hi,
>>>>
>>>> Today ZGC reserves a huge chunk of virtual address space when the 
>>>> JVM starts. This typically succeeds because we grab the VA before 
>>>> anyone else has time to do so. But if some ASLR library or 
>>>> something was to grab a tiny part of the desired VA, ZGC can't 
>>>> start. We should support discontiguous heap reservations to support 
>>>> this.
>>>>
>>>> On linux, by default, this does not happen. But on OS X, it does 
>>>> happen relatively frequently. So we need to fix this to allow a mac 
>>>> port.
>>>>
>>>> This patch implements a recursive algorithm for finding holes at 
>>>> 2MB granularities in the normally contiguous reservation when 
>>>> initializing the heap, removing them from our VA.
>>>>
>>>> This patch depends on 8224815, which depends on 8229189 and 
>>>> 8229278. They are all out for review.
>>>>
>>>> Webrev:
>>>> http://cr.openjdk.java.net/~eosterlund/8224820/webrev.00/
>>>
>>> Looks good. However, please pass down max_capacity from 
>>> ZPageAllocator to ZVirtualMemory's constructor, instead of reading 
>>> MaxHeapSize.
>>>
>>> cheers,
>>> Per
>>>
>>>>
>>>> Bug:
>>>> https://bugs.openjdk.java.net/browse/JDK-8224820
>>>>
>>>> Thanks,
>>>> /Erik




More information about the hotspot-gc-dev mailing list