RFR: 8337217: Port VirtualMemoryTracker to use VMATree [v8]

Afshin Zafari azafari at openjdk.org
Mon Dec 9 10:19:50 UTC 2024


On Thu, 5 Dec 2024 21:38:25 GMT, Robert Toyonaga <duke at openjdk.org> wrote:

>> Afshin Zafari has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   a missed change in a shenandoah file.
>
> src/hotspot/share/nmt/regionsTree.hpp line 57:
> 
>> 55:       inline void clear_node() { _node = nullptr; }
>> 56:       inline VMATree::position position() { return _node->key(); }
>> 57:       inline bool is_committed_begin() { return ((uint8_t)out_state() & (uint8_t)VMATree::StateType::Committed) >= 2; }
> 
> This allows a region to be committed but not reserved?

`StateType::Committed` is `3` and `StateType::Reserved` is `1`. So, `committed` means `reserved and committed`. The above predicate checks the bit 1 of the `state` if it is set or not.

> src/hotspot/share/nmt/regionsTree.hpp line 105:
> 
>> 103:         if (prev.is_committed_begin()) {
>> 104:           comm_size += curr.distance_from(prev);
>> 105:           if (!curr.is_committed_begin()) {
> 
> Shouldn't it be impossible to have 2 back-to-back committed regions? Wouldn't they already be coalesced by `VMATree::register_mapping`?

Only regions with the same `MemTag` can be merged into one. It is possible to have two adjacent committed regions with different `MemTag`s.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20425#discussion_r1875719211
PR Review Comment: https://git.openjdk.org/jdk/pull/20425#discussion_r1875721040


More information about the hotspot-runtime-dev mailing list