There is a suggestion to add two new parameters to J9PortVmemParams:
Abstract Page size
Offset in Abstract Page
An Abstract Page size is any power of two value. The Abstract Page has no relation to virtual memory allocation layout (physical page size, allocation ranges etc).
An Offset in Abstract Page is any value smaller then Abstract Page size.
Leadind part of memory range from Abstract Page Start to allocation bottom address as well as trailing part from allocation top address to Abstract Page End should not be allocated.
If Abstract Page size parameter is specified:
An allocation range borders should be aligned to Abstract Page size: J9PortVmemParams.startAddress(lowest adress for allocation start address) up and J9PortVmemParams.endAddress(highest adress for allocation start address) down.
The Abstract Page size should be used as step for allocation attempts (instead of physical page size step in current code).
If physical page size is smaller then Abstract Page size an Offset in Abstract Page should be aligned down to physical page size.
Current allocation loop logic for allocation direction bottom up looks like:
Current virtual memory allocation mechanism is a partial case of proposed extension with Abstract Page size equal physical page size and Offset 0 (except ZOS where multiple allocation attempts logic is not implemented yet).
The first platform needs this implementation is ZOS to simplify memory allocation control for Guarded Storage (GS). The Abstract Page size in this case might be selected to be equal to desired GS size, The notion of Abstract Page size and Offset would be enough to get memory allocation properly. In case if ZOS supports memory allocation hints (see https://github.com/eclipse/omr/pull/3923) we can do multiple attempts of memory allocation to get desired memory geometry. Otherwise memory can be allocated at any place (considering other J9PortVmemParams values) however requestedSize should be increased by Abstract Page size to make proper alignment possible.
zLinux might require implementation to support GS properly as well.
Another application area for this feature for example might be speeding mmap() style allocation for small pages.
New parameters can be ignored in other platforms until implemented.
There is a suggestion to add two new parameters to J9PortVmemParams:
An Abstract Page size is any power of two value. The Abstract Page has no relation to virtual memory allocation layout (physical page size, allocation ranges etc).
An Offset in Abstract Page is any value smaller then Abstract Page size.
Leadind part of memory range from Abstract Page Start to allocation bottom address as well as trailing part from allocation top address to Abstract Page End should not be allocated.
If Abstract Page size parameter is specified:
Current allocation loop logic for allocation direction bottom up looks like:
So for case if Abstract Page size is larger then physical page size and allocation direction is bottom up an allocation cycle would be:
Current virtual memory allocation mechanism is a partial case of proposed extension with Abstract Page size equal physical page size and Offset 0 (except ZOS where multiple allocation attempts logic is not implemented yet).
The first platform needs this implementation is ZOS to simplify memory allocation control for Guarded Storage (GS). The Abstract Page size in this case might be selected to be equal to desired GS size, The notion of Abstract Page size and Offset would be enough to get memory allocation properly. In case if ZOS supports memory allocation hints (see https://github.com/eclipse/omr/pull/3923) we can do multiple attempts of memory allocation to get desired memory geometry. Otherwise memory can be allocated at any place (considering other J9PortVmemParams values) however requestedSize should be increased by Abstract Page size to make proper alignment possible. zLinux might require implementation to support GS properly as well.
Another application area for this feature for example might be speeding mmap() style allocation for small pages.
New parameters can be ignored in other platforms until implemented.