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

Afshin Zafari azafari at openjdk.org
Sun Jun 1 06:53:58 UTC 2025


On Fri, 30 May 2025 17:37:47 GMT, Gerard Ziemski <gziemski at openjdk.org> wrote:

>> Afshin Zafari has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   visualizations added. 1st try.
>
> src/hotspot/share/nmt/vmatree.hpp line 249:
> 
>> 247:   };
>> 248: 
>> 249:   enum Operation {Release, Reserve, Commit, Uncommit, Invalid};
> 
> Can we drop `Invalid` and simplify the code?
> 
>  ```
>  enum Operation {Release, Reserve, Commit, Uncommit};
>   struct RequestInfo {
>     position A, B;
>     StateType _op;
>     MemTag tag;
>     SIndex callstack;
>     bool use_tag_inplace;
>     Operation op() const {
>       return
>             _op == StateType::Reserved && !use_tag_inplace  ? Operation::Reserve  :
>             _op == StateType::Committed                     ? Operation::Commit   :
>             _op == StateType::Reserved &&  use_tag_inplace  ? Operation::Uncommit :
>              Operation::Release;
>     }
> 
>     size_t op_to_index() const {
>       return
>             _op == StateType::Reserved && !use_tag_inplace  ? 1 :
>             _op == StateType::Committed                     ? 2 :
>             _op == StateType::Reserved &&  use_tag_inplace  ? 3 :
>             0;
>     }

We need some invalid checking in the impl of register_mapping. How do we detect and report invalid values then?

> test/hotspot/gtest/nmt/test_vmatree.cpp line 3211:
> 
>> 3209:     //            1         2         3         4         5
>> 3210:     //  012345678901234567890123456789012345678901234567890
>> 3211:     //  rrrrrrrrrr..........rrrrrrrrrr
> 
> What is this comment supposed to show?
> 
> I cleaned up, some comments and created a branch https://github.com/openjdk/jdk/compare/master...gerard-ziemski:jdk:gerard-8351661 in case you want to see it.

In the branch you sent the link, almost all of the new format comments are removed. Is that correct?

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

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


More information about the hotspot-runtime-dev mailing list