RFR: 8263476: NMT: Stack guard pages should not be marked as committed [v3]

Albert Mingkun Yang ayang at openjdk.org
Tue Aug 5 09:16:04 UTC 2025


On Tue, 5 Aug 2025 02:07:47 GMT, David Holmes <dholmes at openjdk.org> wrote:

> Why? What is the difference? Can we fail to get a stack-page when we need it if it was only reserved?

Those guard-pages should never be accessed; we have called `os::guard_memory` on them, so accessing them causes segfault. Since they will never use any physical memory, using committed-memory for them is unnecessary, and incurs some implementation complexity, which this patch tries to clean up.

> The issue description seems concerned with NMT output but you are actually making a significant change to the guard-page functionality ...

Indeed, the diff actually doesn't touch any NMT code; it changes how stack-guard-pages is implemented. I should update the ticket description to avoid confusions.

> Note that this is not an expected case and we don't really support running the VM on the primordial thread and strongly advise against it. How did you test this?

`pd_create_stack_guard_pages` contains some comments/doc explaining how to handle the special case for the primordial-thread, so I revised the existing implementation to support the new reserve-only mechanism. I ran the usual tier1-3 testing.

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

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


More information about the hotspot-runtime-dev mailing list