Skip to content

Commit

Permalink
Merge pull request #16447 from tajila/criu6
Browse files Browse the repository at this point in the history
Release all free pages in balanced GC
  • Loading branch information
amicic authored Dec 9, 2022
2 parents 38c0a73 + 35c5252 commit 7cafd4b
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
17 changes: 16 additions & 1 deletion runtime/gc_vlhgc/MemorySubSpaceTarok.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

/*******************************************************************************
* Copyright (c) 1991, 2021 IBM Corp. and others
* Copyright (c) 1991, 2022 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -1636,3 +1636,18 @@ MM_MemorySubSpaceTarok::adjustExpansionWithinFreeLimits(MM_EnvironmentBase *env,
}
return result;
}

uintptr_t
MM_MemorySubSpaceTarok::releaseFreeMemoryPages(MM_EnvironmentBase* env, uintptr_t memoryType)
{
GC_MemorySubSpaceRegionIterator regionIterator(this);
MM_HeapRegionDescriptorVLHGC *region = NULL;
uintptr_t releasedPages = 0;

while (NULL != (region = (MM_HeapRegionDescriptorVLHGC*)regionIterator.nextRegion())) {
if (NULL != region->getMemoryPool()) {
releasedPages += region->getMemoryPool()->releaseFreeMemoryPages(env);
}
}
return releasedPages;
}
4 changes: 3 additions & 1 deletion runtime/gc_vlhgc/MemorySubSpaceTarok.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

/*******************************************************************************
* Copyright (c) 1991, 2021 IBM Corp. and others
* Copyright (c) 1991, 2022 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -299,6 +299,8 @@ class MM_MemorySubSpaceTarok : public MM_MemorySubSpace
*/
bool consumeFromTaxationThreshold(MM_EnvironmentBase *env, uintptr_t bytesToConsume);

virtual uintptr_t releaseFreeMemoryPages(MM_EnvironmentBase* env, uintptr_t memoryType);

/**
* Create a MemorySubSpaceGeneric object
*/
Expand Down
3 changes: 3 additions & 0 deletions test/functional/cmdLineTests/criu/playlist.xml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@
<variation>-Xjit -XX:+CRIURestoreNonPortableMode</variation>
<variation>-Xint -XX:+CRIURestoreNonPortableMode</variation>
<variation>-Xjit:count=0 -XX:+CRIURestoreNonPortableMode</variation>
<variation>-Xgcpolicy:balanced</variation>
<variation>-Xgcpolicy:optthruput</variation>
<variation>-Xgcpolicy:metronome</variation>
</variations>
<command>
TR_Options=$(Q)exclude={org/openj9/criu/TimeChangeTest.nanoTimeInt()J},dontInline={org/openj9/criu/TimeChangeTest.nanoTimeInt()J|org/openj9/criu/TimeChangeTest.nanoTimeJit()J},{org/openj9/criu/TimeChangeTest.nanoTimeJit()J}(count=1)$(Q) \
Expand Down

0 comments on commit 7cafd4b

Please sign in to comment.