[ZGC] [aarch64] Unable to allocate heap for certain Linux kernel configurations

Stefan Karlsson stefan.karlsson at oracle.com
Mon Aug 31 09:45:18 UTC 2020


Hi Florian,

On 2020-08-28 22:21, Florian Weimer wrote:
> * Stefan Karlsson:
> 
>> Maybe I misunderstand this point, but we use fixed addresses when we
>> probe the address space, but we don't use MAP_FIXED:
>>
>> static bool map(uintptr_t start, size_t size) {
>>    const void* const res = mmap((void*)start, size, PROT_NONE,
>> MAP_ANONYMOUS|MAP_PRIVATE|MAP_NORESERVE, -1, 0)
>>
>> bool ZVirtualMemoryManager::reserve_contiguous_platform(uintptr_t
>> start, size_t size) {
>>    // Reserve address views
>>    const uintptr_t marked0 = ZAddress::marked0(start);
>>    const uintptr_t marked1 = ZAddress::marked1(start);
>>    const uintptr_t remapped = ZAddress::remapped(start);
>>
>>    if (!map(marked0, size)) {
> 
> Note that you can speed this up a little bit on recent-ish kernels if
> you use MAP_FIXED_NOREPLACE.

I didn't realize that this would make the probing faster. I tested this 
by blocking out the address ranges we probe with:


   reserve_contiguous_platform(ZAddress::marked0(0), ZAddressOffsetMax);
   reserve_contiguous_platform(ZAddress::marked1(0), ZAddressOffsetMax);
   reserve_contiguous_platform(ZAddress::remapped(0), ZAddressOffsetMax);

and ran with and without MAP_FIXED_NOREPLACE. I could see a decrease in 
in the worst-case times. Is this something you want to provide a patch 
for? If not, I can create a JBS entry and send out a patch for review.

Thanks,
StefanK

> 
> Thanks,
> Florian
> 


More information about the hotspot-gc-dev mailing list