RFR: 8354115: NMT: VMATree should not accept `uncommit` a `released` region [v2]

Afshin Zafari azafari at openjdk.org
Fri Apr 11 12:45:03 UTC 2025


On Thu, 10 Apr 2025 15:19:54 GMT, Gerard Ziemski <gziemski at openjdk.org> wrote:

>> Afshin Zafari has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   returns invalid SummaryDiff, instead of assert.
>
> src/hotspot/share/nmt/vmatree.hpp line 183:
> 
>> 181:       }
>> 182:     }
>> 183:     bool is_valid() const {
> 
> How about more descriptive name, such as `is_non_free()` or `was_allocated()`, `was_touched()` something like that to mark that this was used, `valid` is too generic?

Renamed to `has_error()`.

> test/hotspot/gtest/nmt/test_vmatree.cpp line 745:
> 
>> 743: 
>> 744: TEST_VM_F(NMTVMATreeTest, UncommmitReleasedRegion) {
>> 745:   {
> 
> I would also add this case (which is the one I used originally to find this issue):
> 
> 
>     Tree tree;
>     // 0..............................
>     // 0.......40----60...............
>     VMATree::SummaryDiff diff = tree.uncommit_mapping(40, 20, rd2);
>     EXPECT_FALSE(diff.is_valid())

Thanks for reminding. Handling this case is also added.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24572#discussion_r2039493170
PR Review Comment: https://git.openjdk.org/jdk/pull/24572#discussion_r2039492498


More information about the hotspot-runtime-dev mailing list