RFR: 8263476: Use reserved memory for stack guard pages [v3]
Albert Mingkun Yang
ayang at openjdk.org
Tue Aug 5 18:13:03 UTC 2025
On Tue, 5 Aug 2025 18:00:34 GMT, Zhengyu Gu <zgu at openjdk.org> wrote:
>> Albert Mingkun Yang has updated the pull request incrementally with one additional commit since the last revision:
>>
>> review
>
> src/hotspot/os/linux/os_linux.cpp line 3478:
>
>> 3476: ::munmap((void*)stack_extent, (uintptr_t)(addr + size - stack_extent));
>> 3477: }
>> 3478: return os::pd_attempt_reserve_memory_at(addr, size, !ExecMem) != nullptr;
>
> This patch indeed goes beyond my original intention. IIRC, my intention was to replace `os::commit()` with `::mprotect()` to set protection on stack guard pages.
I think our starting point is the same, dropping the use of `commit` for stack-guard-pages. However, I encountered some complication (linux main-thread and windows) along the way, which caused the patch to take this shape.
This particular line (L3478) is for linux main-thread only.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26571#discussion_r2255008389
More information about the hotspot-runtime-dev
mailing list