RFR: 8255414: Ensure OS functions always report to NMT

David Holmes dholmes at openjdk.org
Thu Mar 2 21:55:23 UTC 2023


On Thu, 2 Mar 2023 14:05:14 GMT, Johan Sjölen <jsjolen at openjdk.org> wrote:

> Hi,
> 
> This PR attempts to enforce the convention that:
> 
> 1. Public `os` functions report to NMT
> 2. `pd_` prefixed functions do not report to NMT
> 3. Public `os` functions call into `pd_`-prefixed functions to do the actual work.
> 
> This is a convention that has been only partially enforced, leading to some difficulties. For example, it's easy for double-accounting to NMT can occur if it's not clear what the `pd_`-prefixed functions do and do not do.

Sorry Johan but I don't agree with this approach.

src/hotspot/os/bsd/os_bsd.cpp line 1638:

> 1636: bool os::pd_create_stack_guard_pages(char* addr, size_t size) {
> 1637:   return os::pd_commit_memory(addr, size, !ExecMem);
> 1638: }

Sorry but this is wrong IMO. A pd_ function should in general still call the os:: version of other functions because it doesn't know what that might do in addition to eventually calling the pd_ variant.

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

Changes requested by dholmes (Reviewer).

PR: https://git.openjdk.org/jdk/pull/12832


More information about the hotspot-runtime-dev mailing list