RFR: 8340103: Add internal set_flag function to VMATree [v11]

Thomas Stuefe stuefe at openjdk.org
Tue Nov 5 09:25:29 UTC 2024


On Tue, 5 Nov 2024 09:13:05 GMT, Johan Sjölen <jsjolen at openjdk.org> wrote:

>> src/hotspot/share/nmt/vmatree.cpp line 229:
>> 
>>> 227: }
>>> 228: #endif
>>> 229: 
>> 
>> This coding would benefit from better (or actually, any :-) comments.
>> 
>> Please describe what this function does. Important points are:
>> - what is the supposed behavior when tagging over multiple ranges?
>> - what if there are address holes in that range?
>
>>what if there are address holes in that range?
> 
> That's a good point. The function mainly exists to provide support for `record_virtual_memory_tag`, so I haven't thought too hard about the edge cases. In the case of `Released` nodes, I think we're still safe in that we don't look at the remaining state of the node. Anyway, some docs is in order.

An interesting point to think about (I did not look into the code): released sections should always coalesce, right? So they always should have the same properties (null stack and mtNone), then the tree coalesces them automatically. I'm pretty sure we do this already.

But we must then make sure we don't set the tag for released sections.

We also could just say set_tag is not allowed in released sections, and if the range spans over an address hole, just assert. In the way VMATree is used, that is almost certainly an error.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20994#discussion_r1829003684


More information about the hotspot-runtime-dev mailing list