RFR: 8351661: NMT: VMATree should support separate call-stacks for reserve and commit operations [v29]
Afshin Zafari
azafari at openjdk.org
Thu May 22 09:10:00 UTC 2025
On Wed, 21 May 2025 19:44:18 GMT, Gerard Ziemski <gziemski at openjdk.org> wrote:
>> Afshin Zafari has updated the pull request incrementally with one additional commit since the last revision:
>>
>> fixed a missed change in test.
>
> For this case:
>
>
> {// Check committing into a reserved region inherits the call stacks
> VMATree::RegionData call_stack_test(si_1, mtTest);
> VMATree::RegionData call_stack_none(si_2, mtNone);
> VMATree::RegionData call_stack_nmt(si_2, mtNMT);
> Tree tree;
> tree.reserve_mapping(0, 50, call_stack_test); // reserve in an empty tree
> tree.commit_mapping(25, 10, call_stack_nmt, true); // commit at the middle of the region
> tree.print_timeline_on();
> }
>
>
> I know that we are passing `true` for `use_tag_inplace` here, but it just does not feel right to get this:
>
> ```
> 1 2 3 4 5 6
> 0123456789012345678901234567890123456789012345678901234567890123456789
> AAAAAAAAAAAAAAAAAAAAAAAAAbbbbbbbbbbCCCCCCCCCCCCCCC....................
> Legend:
> A - Test (reserved)
> b - Test (committed)
> C - Test (reserved)
> . - None (free/released)
>
>
> I was expecting this:
>
> ```
> 1 2 3 4 5 6
> 0123456789012345678901234567890123456789012345678901234567890123456789
> AAAAAAAAAAAAAAAAAAAAAAAAAbbbbbbbbbbCCCCCCCCCCCCCCC....................
> Legend:
> A - Test (reserved)
> b - Native Memory Tracking (committed)
> C - Test (reserved)
> . - None (free/released)
>
>
> I don't think we should be allowing `use_tag_inplace` to modify the behavior this much. Instead of `use_tag_inplace` we could accept mtNone to inherit the tag already in place? No need for that extra parameter?
@gerard-ziemski , in the new visualization format we write Legend with letters `A, a, B, b, C, c, D, d` that are not reflecting the meanings `Reserved, Released, Committed`. We could use `r, ., C` instead. And since they are not needed to repeat for every visualization, we can describe them at the top of the file once and avoid repeating them.
We also may need to define letters for tags and/or call-stacks. I have the suggestion as:
// 1 2 3 4 5 6 7
// 0123456789012345678901234567890123456789012345678901234567890123456789
// CCCCCCCCCCCCCCCCCCCCrrrrrCCCCCCCCCCrrrrrCCCCCCCCCC....................
// TTTTTTTTTTTTTTTTTTTTnnnnnGGGGGGGGGGdddddJJJJJJJJJJ
// Legend:
// T mtTest
// n mtNMT
// G mtGC
// d mtClassShared(CDS)
// J mtJavaHeap
I used alternative capital and small letters just for better readability.
This style can be used also for call-stacks.
What do you think?
-------------
PR Comment: https://git.openjdk.org/jdk/pull/24028#issuecomment-2900463147
More information about the hotspot-runtime-dev
mailing list