RFR: 8252500: ZGC on aarch64: Unable to allocate heap for certain Linux kernel configurations [v2]

Christoph Göttschkes cgo at openjdk.java.net
Mon Sep 7 10:18:52 UTC 2020


On Mon, 7 Sep 2020 09:32:13 GMT, Stefan Karlsson <stefank at openjdk.org> wrote:

>> Christoph Göttschkes has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Changed constants from #define to typed static const variables.
>>   Changed the log_warning to a log_warning_p, so it is reported in hs_err
>>   file.
>>   mummap the result of mmap directly after the mmap call to be able to
>>   break out of the loop, instead of check the max_address_bit ==
>>   0 precondition.
>>   Fixed an 'off by one' mistake.
>
> src/hotspot/cpu/aarch64/gc/z/zGlobals_aarch64.cpp line 150:
> 
>> 148:   size_t max_address_bit = 0;
>> 149:   const size_t page_size = os::vm_page_size();
>> 150:   for (int i = DEFAULT_MAX_ADDRESS_BIT; i > MINIMUM_MAX_ADDRESS_BIT && max_address_bit == 0; --i) {
> 
> There's a bit of a mismatch between the type of 'i' and 'max_address_bit'. See also 'BitsPerSize_t -
> count_leading_zeros((size_t) result_addr) - 1;'. I think that changing max_address_bit to be an int, and getting rid of
> the size_t's here will fix that.

I did it the other way around, and made 'i' of type size_t, since 'i' is the only int variable left and all the others
are of type size_t.

-------------

PR: https://git.openjdk.java.net/jdk/pull/40



More information about the hotspot-gc-dev mailing list