RFR: 8280056: gtest/LargePageGtests.java#use-large-pages failed "os.release_one_mapping_multi_commits_vm" [v2]
Afshin Zafari
azafari at openjdk.org
Fri Oct 20 08:17:35 UTC 2023
On Wed, 18 Oct 2023 14:58:15 GMT, Afshin Zafari <azafari at openjdk.org> wrote:
>> The `attempt_allocate_memory_at(addr, size)` may fail for some reasons that `::mmap` will report. To find out why an attempt failed, an `int *` is passed down deep to the `::mmap` to return the `ERRNO` back to the callers.
>> This error code is used in gTest test case to show a proper message.
>>
>> The changed test case never failed after 10K+ repetitions, but in case it happens in future the reason is also printed out.
>
> Afshin Zafari has updated the pull request incrementally with one additional commit since the last revision:
>
> some pd_xxx calls were missed.
In my previous comment, I meant undoing all my changes and just change the gtest such that returning `nullptr` is an EXPECTED and also ACCEPTED case. It is not guaranteed that *any attempt to allocate memory at a requested address always returns a valid address that is the same as the requested one*. The **attempt** part in the method's name explicitly says so. My suggestion is only one change like this `if (returned_address != nullptr) ASSERT_EQ(returned_address, requested_address);`
If we know why this case may happen (concurrent same requests or ...), or don't care why it happened, then there would be no need to return `ERRNO` from `::mmap` the long way up to the gtest and/or logging it. Improving the test or replacing it can be considered as other long term choices.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/16240#issuecomment-1772284604
More information about the hotspot-runtime-dev
mailing list