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

Erik Österlund eosterlund at openjdk.java.net
Mon Sep 7 12:19:04 UTC 2020


On Mon, 7 Sep 2020 12:11:46 GMT, Erik Österlund <eosterlund 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 (size_t i = DEFAULT_MAX_ADDRESS_BIT; i > MINIMUM_MAX_ADDRESS_BIT; --i) {
> 
> Should the loop condition be MINIMUM_MAX_ADDRESS_BIT *inclusive* instead of exclusive? Seems weird that it is
> exclusive, when we later check if max_address_bit < MINIMUM_MAX_ADDRESS_BIT return MINIMUM_MAX_ADDRESS_BIT, which seems
> like exactly what will happen if the loop would have advanced to MINIMUM_MAX_ADDRESS_BIT (and then finish the loop).

Not sure how to comment a few lines below where you conditionally return MINIMUM_MAX_ADDRESS_BIT in this new cool GUI.
Anyway, you could use MIN2 to return MIN2(MINIMUM_MAX_ADDRESS_BIT, max_address_bit) to make the intention more clear.

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

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



More information about the hotspot-gc-dev mailing list