RFR: 8351661: NMT: VMATree should support separate call-stacks for reserve and commit operations [v25]

Gerard Ziemski gziemski at openjdk.org
Tue May 13 17:27:06 UTC 2025


On Mon, 12 May 2025 11:21:41 GMT, Afshin Zafari <azafari at openjdk.org> wrote:

>> In NMT detail mode, we need to have separate call-stacks for Reserve and Commit operations.
>> This PR adds a second stack to every node that will be used when committing (and uncommitting) the start node of a reserved region.
>
> Afshin Zafari has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 27 additional commits since the last revision:
> 
>  - Merge remote-tracking branch 'origin/master' into _8351661_separate_call_stack_reserve_commit
>  - fixed one case.
>  - test with random requests passes now.
>  - semantic text added.
>  - more tests for full coverage of update_region.
>  - fixes for cross-compilations
>  - removed print_on for release build success.
>  - complete code coverage for new impl. All tests pass.
>  - new version. All tests except one passed.
>  - second try
>  - ... and 17 more: https://git.openjdk.org/jdk/compare/ee6ab6ca...043c11d6

src/hotspot/share/nmt/vmatree.cpp line 654:

> 652:   });
> 653:   out->cr();
> 654: }

I have a different `print_on` function, called `print_timeline_on` which can produce output, such as:


          1         2         3         4         5
01234567890123456789012345678901234567890123456789
..........AAAAAAAAAA..........CCCCddddEE..........
Legend:
 A - GC (reserved)
 . - free
 C - Test (reserved)
 d - Test (committed)
 E - Test (reserved)
 . - free


instead of:

`10 (GC) - reserved [0, --]-> 20 (Unknown) - released [2147483646, --]-> 30 (Test) - reserved [0, --]-> 34 (Test) - committed [0, 0]-> 38 (Test) - reserved [0, --]-> 40 (Unknown) - released [2147483646, --]->` 

for tree:


    VMATree tree;
    Tree::RegionData gc(si, mtGC);
    Tree::RegionData test(si, mtTest);
    tree.reserve_mapping(10, 10, gc);
    tree.reserve_mapping(30, 10, test);
    tree.commit_mapping(34, 4, test);


Which I personally find easier to parse.

If you like, we can:

1. add this function to this fix, in case others find its output useful
2. add the output generated by this function to the comments for each of the cases in test_vmatree.cpp

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24028#discussion_r2087318994


More information about the hotspot-runtime-dev mailing list