RFR: 8331539: [REDO] NMT: add/make a mandatory MEMFLAGS argument to family of os::reserve/commit/uncommit memory API [v2]

Daniel D. Daugherty dcubed at openjdk.org
Wed May 22 16:11:03 UTC 2024


On Wed, 22 May 2024 12:09:14 GMT, Afshin Zafari <azafari at openjdk.org> wrote:

>> This PR fixes the problems existed in the original PR (https://github.com/openjdk/jdk/pull/18745).  There are two main fixes here:
>>   1- `ReservedSpace` class is changed so that the `_flag` member never changes after it is set in ctor. Since reserving memory regions may go thru a try and fail sequence of reserve-release pairs, changing the `_flag` member at failed releases would lead to incorrect flags in subsequent reserves.
>> Also, some assertion are added to the getters of a `ReservedSpace` to check if the region is successfully reserved.
>> 
>>   2- In order to have adjacent regions with different flags, CDS reserves a (large) region `R` and then splits it into sub regions `R1` and `R2` (`R == <---R1---><--R2-->`). At release time, NMT tracks only `R` and ignores releasing `R1` and `R2`. This ignoring is problematic when a requested region `R` is size-aligned to `R1---R---R2` first and then the `R1` and `R2` released (`chop_extra_memory` function is called for this). In this case, NMT ignores tracking `R1` and `R2` with assumption that a containing `R` will be released. Therefore, `R1` and `R2` remain in the NMT region-list and when a new reserve happens at that regions, NMT complains by raising an exception.
>
> Afshin Zafari has updated the pull request incrementally with one additional commit since the last revision:
> 
>   fixed the missing parts of shenandoahHeap.cpp

Please document the testing that has been done on this PR.

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

PR Comment: https://git.openjdk.org/jdk/pull/19343#issuecomment-2125172737


More information about the shenandoah-dev mailing list