RFR: 8263476: Use reserved memory for stack guard pages [v3]

David Holmes dholmes at openjdk.org
Wed Aug 6 02:06:03 UTC 2025


On Mon, 4 Aug 2025 14:04:15 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

>> Use reserved (instead of committed) memory for stack-guard-pages on linux like systems.
>> 
>> `os::must_commit_stack_guard_pages` uses `commit` in its name, but `commit` usually has specific meanings in OS memory context. The actual question the caller is asking is whether the caller needs to do some preparation work before marking the guard-pages as inaccessible. To avoid confusion, I changed it to "allocate". Other suggestions are welcome.
>> 
>> Test: tier1-3
>
> Albert Mingkun Yang has updated the pull request incrementally with one additional commit since the last revision:
> 
>   review

> 8263476: Use reserved memory for stack guard pages

But this is still inaccurate as there are no changes to Windows. And while I can see where you dropped `os::commit` for Linux, I can't see what causes changes on the other OS. ?? Is this really just a Linux change?

I also still do not see any motivating argument for this. What is the benefit? You say it removes some complexity but I see no evidence of that in the PR. And doing different things on different platforms reduces the overall understandability of the code.

> but don't see any particular test involved for that area of code. Anyway, I will run higher tiers of tests.

You seem to be missing my point. You can run all the tiers you like and you will not be testing the code changes that relate to the primordial thread because we never use the primordial thread to run the VM (again I think we have one test that does so to ensure such a scenario at least does not crash on startup). If you are making changes to the way the stack is managed for the primordial thread then you are going to have to come up with a way to test those changes - or else propvide a convincing argument as to why the changes can be determined correct by observation. We basically leave that code alone.

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

PR Comment: https://git.openjdk.org/jdk/pull/26571#issuecomment-3157170151


More information about the hotspot-runtime-dev mailing list