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

Gerard Ziemski gziemski at openjdk.org
Fri Mar 14 16:07:04 UTC 2025


On Thu, 13 Mar 2025 17:53:22 GMT, Afshin Zafari <azafari at openjdk.org> wrote:

>> src/hotspot/share/nmt/vmatree.cpp line 100:
>> 
>>> 98:         stB.in.set_stack(leqA_n->val().out.stack());
>>> 99:         stA.out.set_second_stack(metadata.stack_idx);
>>> 100:         stB.in.set_second_stack(metadata.stack_idx);
>> 
>> Did we consider naming them differently?
>> 
>> One obvious choice would be ReserveStack and CommitStack?
>> 
>> Right now, we need to mentally map them one way, and I am afraid that we could possibly get it reversed at some other point in code...
>
> One StackIndex is used for all reserve/commit/uncommit/release operations.
> We need another one just used for committing and uncommitting the start-node of the reserved region.
> So names like ReserveXXX and CommitXXX would not fit. 
> I do not insist on the chosen names and am open to proper alternatives.

In your gtest you have a test called "SeparateStacksForCommitAndReserve", which seems to say to me, that commit and reserve would be good names?

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

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


More information about the hotspot-runtime-dev mailing list