RFR: 8263464: NMT: assert in gtest os.release_multi_mappings_vm [v2]
Gerard Ziemski
gziemski at openjdk.org
Mon May 8 16:49:32 UTC 2023
On Mon, 8 May 2023 06:10:02 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:
>> Gerard Ziemski has updated the pull request incrementally with one additional commit since the last revision:
>>
>> support partial release, add corresponding test
>
> test/hotspot/gtest/runtime/test_os.cpp line 553:
>
>> 551: }
>> 552: #endif // !AIX
>> 553:
>
> - This tests case B, and we need case C and D too.
> - You should make the first - middle - release the testing release with the partwise releasing. The final release is just to clean up the mess. For that to work, the stripes must be larger and a multiple of os::allocation_granularity, since otherwise you cannot release them partwise.
>
> Would be cool if you fit all of these cases into a single function, e.g.
>
> static void test_multi_release(size_t stripe_size, int num_stripes, size_t release_range_offset, size_t release_range_size)
>
>
> And then call them 4 times in 4 tests, for each of the test cases. E.g. with a stripe len set to 1M could be like this:
>
>
> TEST_VM(TEST_VM, release_multi_mappings_full_regions) {
> test_multi_release(M, 4, M, 2*M); // release stripes 2 and 3 fully
> }
>
> TEST_VM(TEST_VM, release_multi_mappings_partial_regions) {
> test_multi_release(M, 4, M + 512*K, 512*K + M); // release stripe 2 partly, stripe 3 fully
> }
>
> TEST_VM(TEST_VM, release_multi_mappings_partial_regions) {
> test_multi_release(M, 4, M, M + 512*K); // release stripe 2 fully, stripe 3 partly
> }
>
> TEST_VM(TEST_VM, release_multi_mappings_partial_regions) {
> test_multi_release(M, 4, M + 256K, 512 * K); // release a 512K hole into stripe 2
> }
I tried to make a picture of the memory and the parts that should get released for testing:
// allocate [aaaa][bbbb][cccc][dddd]
// 1 release partial [....][bbbb][....][....]
// 2 release partial [....][....][cccc][....]
// 3 release partial [....][bbbb][cccc][....]
// 4 release partial [....][..bb][cccc][....]
// 5 release partial [....][bb..][cccc][....]
// 6 release partial [....][bbbb][cc..][....]
// 7 release partial [....][bbbb][..cc][....]
// 8 release partial [....][..bb][cc..][....]
// 9 release partial [....][bb..][..cc][....]
// 10 release partial [....][bb..][cc..][....]
// 11 release partial [....][..bb][..cc][....]
// 12 release partial [....][.bb.][....][....]
// 13 release partial [....][.bb.][.cc.][....]
Are we still missing any cases?
Did I add too much? (i.e. drop case 13?)
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/13813#discussion_r1187657600
More information about the hotspot-runtime-dev
mailing list