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

Johan Sjölen jsjolen at openjdk.org
Fri Apr 11 08:29:33 UTC 2025


On Thu, 10 Apr 2025 10:02:29 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 incrementally with one additional commit since the last revision:
> 
>   24 test-cases added for full coverage of cases.

Hi,

Are we skipping any cases where an operation is done over multiple regions?

If we have:



    // Post: .........0********20---------25********50--------80********100.........
    //        mtNone    mtTest    mtTest      mtTest   mtTest     mtTest    mtNone
    //        Rl        C         Rs          C        Rs         C         Rl
    //        -         si_1      si_3        si_1     si_1       si_1      -
    //        -         si_2      -           si_2     -          si_2      -


And we uncommit `[0, 100)`, then what is the result?

Are we going to ignore these cases for now?

test/hotspot/gtest/nmt/test_vmatree.cpp line 792:

> 790:     }
> 791: 
> 792:     snprintf(for_this_node, sizeof(for_this_node), "test at line: %d, for node: %d", line_no, et.nodes[i]);

Here, you can use a `stringStream` to print, and then use `.base()` to access the underlying string. That means you have no limit on the length of the line.

test/hotspot/gtest/nmt/test_vmatree.cpp line 876:

> 874:     check_tree(tree, et2, __LINE__);
> 875: 
> 876:     tree.commit_mapping(0, 20, call_stack_2, true); // commit at the begin of the region

beginning

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

PR Review: https://git.openjdk.org/jdk/pull/24028#pullrequestreview-2759420744
PR Review Comment: https://git.openjdk.org/jdk/pull/24028#discussion_r2038974520
PR Review Comment: https://git.openjdk.org/jdk/pull/24028#discussion_r2039044930


More information about the hotspot-runtime-dev mailing list