RFR: 8255414: Ensure OS functions always report to NMT

David Holmes dholmes at openjdk.org
Thu Mar 2 21:59:24 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.

I think the functions that do the actual work should report to NMT. That way if you have a call chain:

os::foo() -> os::pd_foo() -> os::bar() -> os::pd_bar();

then the reporting only happens in `os::pd_bar()`.

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

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


More information about the hotspot-runtime-dev mailing list