RFR: 8315923: pretouch_memory by atomic-add-0 fragments huge pages unexpectedly [v7]

Thomas Stuefe stuefe at openjdk.org
Wed Oct 25 07:45:43 UTC 2023


On Wed, 25 Oct 2023 07:29:48 GMT, Liming Liu <duke at openjdk.org> wrote:

>> 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.

Okay, in that case its fine.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/15781#discussion_r1371290527


More information about the hotspot-runtime-dev mailing list