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

Gerard Ziemski gziemski at openjdk.org
Fri May 30 17:41:00 UTC 2025


On Thu, 22 May 2025 13:37:39 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:
> 
>   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;
    }

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

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


More information about the hotspot-runtime-dev mailing list