RFR: 8335091: NMT: VMATree reserve_mapping and commit_mapping APIs need MEMFLAGS while un/-committing API has no MEMFLAGS arg
Johan Sjölen
jsjolen at openjdk.org
Thu Jul 25 14:20:32 UTC 2024
On Thu, 25 Jul 2024 12:15:02 GMT, Afshin Zafari <azafari at openjdk.org> wrote:
> In committing a region, it is not mandatory to provide a MEMFLAGS flag where the committed region inherits the flag from the main region it resides in.
> In un-committing there is no need to a MEMFLAGS at all.
> The `register_mapping` API of the VMATree *requires* a MEMFLAGS (via metadata arg) in both of these two operations. To do the flag inheriting, it is possible to copy the flag of the left node in the tree to the newly inserted ones.
>
> An optional bool arg (default is false) is added to VMATree API to copy the existing flag of the left node to the new nodes.
Hi,
The general idea of allowing for an overriding strategy in order to let `register_mapping` support some form of the current `uncommit` API is fine. Some notes:
1. The new feature is currently unused. Please implement a user, for example `VMATree::uncommit_mapping` and provide tests for this method also.
2. What happens if we have the following:
```c++
tree.reserve_mapping(0, 10, rd1);
tree.reserve_mapping(10000, 10, rd2, true);
Seems like this will have the second reservation have `mtTest`, no? Maybe the `copy_flag` should only be used for when the starting address is a direct match?
Thanks,
Johan
-------------
Changes requested by jsjolen (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/20330#pullrequestreview-2199449937
More information about the hotspot-runtime-dev
mailing list