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

Afshin Zafari azafari at openjdk.org
Wed May 14 08:18:04 UTC 2025


On Tue, 13 May 2025 17:23:47 GMT, Gerard Ziemski <gziemski at openjdk.org> wrote:

>> 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/07e97161...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

There are a few questions/concerns to use this new output:
- the range of regions in tree may be 100-1000, then we need 1000 columns in print
- not all the regions are used within that range, e.g., only 10-20 and 900-1000 are used. 
- when we use `print_on` for debugging a real tree, the ranges are 16 hexadecimal digits, it would be hard to show them efficiently

I can add this visualization format to the test cases without changing the `print_on`. Is that OK?

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

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


More information about the hotspot-runtime-dev mailing list