Skip to content

Commit

Permalink
Merge pull request #20820 from dmitripivkine/master
Browse files Browse the repository at this point in the history
Add -XXgc:regionSizeWithOverride
  • Loading branch information
amicic authored Dec 12, 2024
2 parents 30b5e75 + 521be19 commit d22effd
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 2 additions & 0 deletions runtime/gc_base/GCExtensions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ class MM_GCExtensions : public MM_GCExtensionsBase {
bool recycleRemainders; /**< true if need to recycle TLHRemainders at the end of PGC, for balanced GC only */

bool forceGPFOnHeapInitializationError; /**< if set causes GPF generation on heap initialization error */
bool isRegionSizeWithOverrideSpecified; /**< set true if -XXgc:regionSizeWithOverride is specified */

enum ContinuationListOption {
disable_continuation_list = 0,
Expand Down Expand Up @@ -440,6 +441,7 @@ class MM_GCExtensions : public MM_GCExtensionsBase {
, freeSizeThresholdForSurvivor(DEFAULT_SURVIVOR_THRESHOLD)
, recycleRemainders(true)
, forceGPFOnHeapInitializationError(false)
, isRegionSizeWithOverrideSpecified(false)
, continuationListOption(enable_continuation_list)
, timingAddContinuationInList(onCreated)
, testContainerMemLimit(false)
Expand Down
10 changes: 10 additions & 0 deletions runtime/gc_modron_startup/mmparseXXgc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1573,6 +1573,16 @@ gcParseXXgcArguments(J9JavaVM *vm, char *optArg)
continue;
}

if (try_scan(&scan_start, "regionSizeWithOverride=")) {
if(!scan_udata_memory_size_helper(vm, &scan_start, &extensions->regionSize, "regionSizeWithOverride=")) {
returnValue = JNI_EINVAL;
break;
}
extensions->isRegionSizeWithOverrideSpecified = true;
continue;
}


/* Couldn't find a match for arguments */
j9nls_printf(PORTLIB, J9NLS_ERROR, J9NLS_GC_OPTION_UNKNOWN, error_scan);
returnValue = JNI_EINVAL;
Expand Down
3 changes: 2 additions & 1 deletion runtime/gc_vlhgc/ConfigurationIncrementalGenerational.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,8 @@ MM_ConfigurationIncrementalGenerational::prepareParameters(OMR_VM *omrVM, UDATA
bool
MM_ConfigurationIncrementalGenerational::verifyRegionSize(MM_EnvironmentBase *env, UDATA regionSize)
{
return regionSize >= TAROK_MINIMUM_REGION_SIZE_BYTES;
MM_GCExtensions *extensions = MM_GCExtensions::getExtensions(env);
return extensions->isRegionSizeWithOverrideSpecified || (regionSize >= TAROK_MINIMUM_REGION_SIZE_BYTES);
}

bool
Expand Down

0 comments on commit d22effd

Please sign in to comment.