RFR: 8340103: Add internal set_flag function to VMATree [v18]
Thomas Stuefe
stuefe at openjdk.org
Thu Nov 7 09:56:46 UTC 2024
On Thu, 7 Nov 2024 09:48:26 GMT, Johan Sjölen <jsjolen at openjdk.org> wrote:
>> Hi!
>>
>> The old VirtualMemoryTracker has a method set_reserved_region_type(address, flag). We implement this for the new VMATree implementation by altering the signature slightly to set_reserved_region_type(address, size, flag). This simplifies the implementation greatly for our new data structure and leads to trivial changes for the callers (all callers already know the size).
>>
>> This PR implements the internal implementation along with tests, but does not change any callers.
>>
>> I also do a few cleanups:
>>
>> - Change `Node` to `TreeNode` in tests, we've seen build failures because of this (probably a precompiled headers issue)
>> - Add a few `print_on` methods for easy debugging
>> - Add a `size` alias, it was a bit confusing that some functions took an argument `position sz`, so changed that to `size sz`
>>
>> Thanks.
>
> Johan Sjölen has updated the pull request incrementally with two additional commits since the last revision:
>
> - Hole
> - Unused
test/hotspot/gtest/nmt/test_vmatree.cpp line 437:
> 435: tree.set_tag(0, 75, mtGC);
> 436: expect_equivalent_form(expected, tree);
> 437: }
I think this shows an error I mentioned before, which should be fixed:
Released regions should only have mtNone as tag and no associated stack. The reason is that we don't want released sections to splinter into different parts, since that makes no sense. Released sections should always coalesce and that is easiest reached by making its properties uniformly "mtNone, no stack"
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20994#discussion_r1832385703
More information about the hotspot-runtime-dev
mailing list