RFR: 8312132: Add tracking of multiple address spaces in NMT [v54]

Thomas Stuefe stuefe at openjdk.org
Tue Apr 30 16:15:13 UTC 2024


On Tue, 30 Apr 2024 15:14:31 GMT, Gerard Ziemski <gziemski at openjdk.org> wrote:

>>>If we really want to rename it, I would name it something like IntervalTree. Since that's what it really is - managing sets of numeric intervals with attributes. But IMHO VMATree is fine.
>> 
>> I prefer `VMATree` because a traditional interval tree as per Wikipedia doesn't perform any sort of merging, it's "just" a set of intervals.
>> 
>> If we do expand VMA it should naively be `VirtualMemoryAreaTree`.
>
> A google search for `VMATree` is not very revealing. Anyone new to this area, will be left wondering what this data structure is (I was).
> 
> I vote for more flushed out name that gets the reader pointed in the right direction (google search on `VirtualMemoryAreaTree` looks more promising).

Neither VMATree nor VirtualMemoryAreaTree are correct. VMATree has the advantage of brevity and the fact that its already ingrained in our brains, so we had conversations about it and at least one [concept document](https://gist.github.com/tstuefe/d9682b7f11b3375da27faa100f45e621) exists.

VirtualMemoryAreaTree OTOH is incorrect and unclear on several levels.

The tree is not a "MemoryTree" in its current form, since it tracks offsets into a file. And it's not "Virtual" by any stretch of the word. It would join the zoo of confusingly named classes like VirtualMemorySpace, which is neither more nor less Virtual than its parent class ReservedSpace.

If we rename it at all, I vote for IntervalTree. Because that's precisely what it is. It tracks intervals with attributes. And if templatized, we can reuse it for any kind of numerical region tracking and any kind of index types that we want.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18289#discussion_r1585138767


More information about the hotspot-dev mailing list