RFR: 8351661: NMT: VMATree should support separate call-stacks for reserve and commit operations [v29]
Afshin Zafari
azafari at openjdk.org
Thu Jun 12 14:11:40 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?
Thank you @gerard-ziemski and @jdksjolen for your reviews.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/24028#issuecomment-2966962304
More information about the hotspot-runtime-dev
mailing list