RFR: 8330076: [NMT] add/make a mandatory MEMFLAGS argument to family of os::reserve/commit/uncommit memory API [v12]

Stefan Karlsson stefank at openjdk.org
Fri Apr 19 09:36:02 UTC 2024


On Fri, 19 Apr 2024 09:09:29 GMT, Afshin Zafari <azafari at openjdk.org> wrote:

>> `MEMFLAGS flag` is used to hold/show the type of the memory regions in NMT. Each call of NMT API requires a search through the list of memory regions.
>> The Hotspot code reserves/commits/uncommits memory regions and later calls explicitly NMT API with a specific memory type (e.g., `mtGC`, `mtJavaHeap`) for that region.  Therefore, there are two search in the list of regions per reserve/commit/uncommit operations, one for the operation and another for setting the type of the region.  
>> When the memory type is passed in during reserve/commit/uncommit operations, NMT can use it and avoid the extra search for setting the memory type.
>> 
>> Tests: tiers1-5 passed on linux-x64, macosx-aarch64 and windows-x64 for debug and non-debug builds.
>
> Afshin Zafari has updated the pull request incrementally with one additional commit since the last revision:
> 
>   local/param `flags` renamed to `alloc_type` to let have `MEMFLAGS flag` param.

There's one tiny nit left, from my POV, otherwise this looks good to me.

src/hotspot/share/memory/virtualspace.cpp line 709:

> 707:   assert(max_commit_granularity > 0, "Granularity must be non-zero.");
> 708: 
> 709: 

This blankline should be reverted.

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

Marked as reviewed by stefank (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/18745#pullrequestreview-2010969083
PR Review Comment: https://git.openjdk.org/jdk/pull/18745#discussion_r1572099614


More information about the shenandoah-dev mailing list