RFR: 8350567: NMT: update VMATree::register_mapping to copy the existing tag of the region [v2]

Johan Sjölen jsjolen at openjdk.org
Mon Mar 3 12:23:53 UTC 2025


On Mon, 3 Mar 2025 11:30:42 GMT, Afshin Zafari <azafari at openjdk.org> wrote:

>> src/hotspot/share/nmt/vmatree.cpp line 210:
>> 
>>> 208: 
>>> 209:   // Finally, we can register the new region [A, B)'s summary data.
>>> 210:   MemTag tag_to_change = use_tag_inplace ? stA.out.mem_tag() : metadata.mem_tag;
>> 
>> Do we ever change the `stA.out.mem_tag()` ? Can't it always be `stA.out.mem_tag()`?
>
> Yes, it is changed in line 79 above.

@afshin-zafari .

Right, but that depends on `use_tag_inplace` being true. So this says:

```c++
MemTag found_memtag; // Assume set
if (use_tag_inplace) {
  stA.mem_tag() =  found_memtag;
} else {
    stA.mem_tag() = metadata.mem_tag;
}
MemTag tag_to_change = use_tag_inplace ? stA.out.mem_tag() : metadata.mem_tag; 


Do you see what I'm saying? You can change the line to `MemTag tag_to_change = stA.out.mem_tag();`.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23771#discussion_r1977426437


More information about the hotspot-runtime-dev mailing list