RFR: 8315923: pretouch_memory by atomic-add-0 fragments huge pages unexpectedly [v7]
Liming Liu
duke at openjdk.org
Wed Oct 25 07:32:46 UTC 2023
On Tue, 24 Oct 2023 13:28:26 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:
>> Liming Liu has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR. The pull request contains one new commit since the last revision:
>>
>> Make the jtreg test check the usage of THP
>
> src/hotspot/share/runtime/os.cpp line 2119:
>
>> 2117: void os::pretouch_memory_common(void* first, void* last, size_t page_size) {
>> 2118: assert(is_aligned(first, page_size), "pointer " PTR_FORMAT " is not page-aligned by %zu", p2i(first), page_size);
>> 2119: assert(is_aligned(last, page_size), "pointer " PTR_FORMAT " is not page-aligned by %zu", p2i(last), page_size);
>
> New assertions, right? Affects all platforms, not only Linux. If possible, please don't change behavior on other platforms.
>
> Have you checked all users of this function? AFAICT calling this with unaligned pointers would have been possible and would have worked.
The assertions were suggested by Kim Barrett [here](https://github.com/openjdk/jdk/pull/15781#discussion_r1340872840). The function is private in os, and supposed to be called by pd_pretouch_memory. I'm fine without the assertions personally.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/15781#discussion_r1371278390
More information about the hotspot-runtime-dev
mailing list