RFR: 8315923: pretouch_memory by atomic-add-0 fragments huge pages unexpectedly [v29]
Thomas Stuefe
stuefe at openjdk.org
Thu Jan 25 11:11:44 UTC 2024
On Thu, 25 Jan 2024 10:55:24 GMT, Johan Sjölen <jsjolen at openjdk.org> wrote:
>> src/hotspot/os/linux/os_linux.cpp line 4402:
>>
>>> 4400:
>>> 4401: // Check the availability of MADV_POPULATE_WRITE.
>>> 4402: FLAG_SET_DEFAULT(UseMadvPopulateWrite, (::madvise(0, 0, MADV_POPULATE_WRITE) == 0));
>>
>> Can we delay this to the first attempt? Switch it off if the first attempt returns EINVAL? Every system call saved at startup is good.
>
> Is that possible? Won't that ~clobber~ replace the user-supplied parameter?
yes you are right. We should only try madvise if the switch is enabled.
And we should do it here, not as I suggested earlier on demand. Because changing flags after init is unexpected (eg PrintFlagsFinal).
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/15781#discussion_r1466209932
More information about the hotspot-runtime-dev
mailing list