Skip to content

Conversation

LinHu2016
Copy link
Contributor

@LinHu2016 LinHu2016 commented Sep 29, 2025

In PR #22116 and #22546, _arrayReservedRegionList and _sharedArrayReservedRegionsBytesUsed has been introduced to share fraction of reserved regions. _arrayReservedRegionList is set in commonAllocationContext(single global list), For numa case, the reserved regions for large array could be allocated from different allocation context(allocation context per numa node and in case there is no free region for the numa note, it could borrow from neighbor numa node). during recycling, there are no extra information indicate which reserved regions are for recycling off-heap array, so potentially it might cause imbalance free memory among numa notes, then affect runtime performance in some cases.

Undate to manage reserved region list per allocation context(numa note) to avoid imbalance free memory caused by reserved regions.

1, for reducing complexity, shared fraction reserved regions still be managed in _arrayReservedRegionList of commom context. set _sharedReserved in AllocateDescriptor for shared fraction reserved region allocation.

2, new _allocationContextArray in SparseVirtualMemory(omr PR eclipse-omr/omr#7956) to store/retrieve allocation context for the reserved regions of large array.

3, handle allocation failure during getSparseAddressAndDecommitLeaves().

#depend: eclipse-omr/omr#7956

*/
MM_AllocationContextTarok *commonContext = (MM_AllocationContextTarok *)env->getCommonAllocationContext();
if (this != commonContext) {
MM_AllocationContextTarok *context = this;
Copy link
Contributor

@amicic amicic Oct 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this could be of type MM_AllocationContextBalanced

then this could cast directly with MM_AllocationContextBalanced:
context = (MM_AllocationContextTarok *)env->getCommonAllocationContext();

and there is no need for a cast at a few other places later

@amicic amicic added the comp:gc label Oct 1, 2025
@LinHu2016 LinHu2016 force-pushed the defrag-offheap3_numa branch 2 times, most recently from 1d3fd91 to 4505844 Compare October 5, 2025 21:09
@LinHu2016 LinHu2016 force-pushed the defrag-offheap3_numa branch 2 times, most recently from 6ffca10 to f9e5f46 Compare October 9, 2025 20:38
In PR eclipse-openj9#22116
and eclipse-openj9#22546,
_arrayReservedRegionList and _sharedArrayReservedRegionsBytesUsed has
been introduced to share fraction of reserved regions.
_arrayReservedRegionList is set in commonAllocationContext(single
global list), For numa case, the reserved regions for large array could
be allocated from different allocation context(allocation context per
numa node and in case there is no free region for the numa note, it
could borrow from neighbor numa node). during recycling, there are no
extra information indicate which reserved regions are for recycling
off-heap array, so potentially it might cause imbalance free memory
among numa notes, then affect runtime performance in some cases.

Undate to manage reserved region list per allocation context(numa note)
to avoid imbalance free memory caused by reserved regions.

1, for reducing complexity, shared fraction reserved regions still be
managed in _arrayReservedRegionList of commom context.
set _sharedReserved in AllocateDescriptor for shared fraction reserved
region allocation.

2, new _allocationContextArray in SparseVirtualMemory(omr PR
eclipse-omr/omr#7956) to store/retrieve
allocation context for the reserved regions of large array.

3, handle allocation failure during getSparseAddressAndDecommitLeaves().

Signed-off-by: lhu <[email protected]>
Change-Id: Ia3b016fca0c3b1faad9d75617d7ab208aafadb3b
Signed-off-by: lhu <[email protected]>
This reverts commit dd8cf24.

Change-Id: Id3d1c9176a18dc2e0a7ac35573b17510e25b9dea
@LinHu2016 LinHu2016 force-pushed the defrag-offheap3_numa branch from f9e5f46 to 59e5d91 Compare October 17, 2025 02:34
Signed-off-by: lhu <[email protected]>
@LinHu2016 LinHu2016 force-pushed the defrag-offheap3_numa branch from 59e5d91 to 9fc159c Compare October 17, 2025 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants