Skip to content

Commit

Permalink
Merge pull request #4780 from amicic/split_param_defaults
Browse files Browse the repository at this point in the history
Scan Queue splitting defaults
  • Loading branch information
youngar committed Jan 29, 2020
2 parents ba0338d + 6b41925 commit 6d5cab8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 19 deletions.
26 changes: 9 additions & 17 deletions gc/base/Configuration.cpp
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 1991, 2019 IBM Corp. and others
* Copyright (c) 1991, 2020 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 @@ -448,35 +448,27 @@ MM_Configuration::initializeGCParameters(MM_EnvironmentBase* env)

/* TODO 108399: May need to adjust -Xmn*, -Xmo* values here if not fully specified on startup options */

Assert_MM_true(0 < extensions->gcThreadCount);

/* initialize packet lock splitting factor */
if (0 == extensions->packetListSplit) {
if (16 >= extensions->gcThreadCount) {
extensions->packetListSplit = extensions->gcThreadCount;
} else if (32 >= extensions->gcThreadCount) {
extensions->packetListSplit = 16 + ((extensions->gcThreadCount - 16) / 4);
} else {
extensions->packetListSplit = 20 + ((extensions->gcThreadCount - 32) / 8);
}
extensions->packetListSplit = (extensions->gcThreadCount - 1) / 8 + 1;
}

#if defined(OMR_GC_MODRON_SCAVENGER)
/* initialize scan cache lock splitting factor */
if (0 == extensions->cacheListSplit) {
if (16 >= extensions->gcThreadCount) {
extensions->cacheListSplit = extensions->gcThreadCount;
} else if (32 >= extensions->gcThreadCount) {
extensions->cacheListSplit = 16 + ((extensions->gcThreadCount - 16) / 4);
} else {
extensions->cacheListSplit = 20 + ((extensions->gcThreadCount - 32) / 8);
}
extensions->cacheListSplit = (extensions->gcThreadCount - 1) / 8 + 1;
}
#endif /* OMR_GC_MODRON_SCAVENGER */

/* initialize default split freelist split amount */
if (0 == extensions->splitFreeListSplitAmount) {
#if defined(OMR_GC_MODRON_SCAVENGER)
#if defined(OMR_GC_MODRON_SCAVENGER)
if (extensions->scavengerEnabled) {
extensions->splitFreeListSplitAmount = (extensions->gcThreadCount - 1) / 8 + 1;
} else
#endif /* OMR_GC_MODRON_SCAVENGER */
#endif /* OMR_GC_MODRON_SCAVENGER */
{
OMRPORT_ACCESS_FROM_OMRPORT(env->getPortLibrary());
extensions->splitFreeListSplitAmount = (omrsysinfo_get_number_CPUs_by_type(OMRPORT_CPU_ONLINE) - 1) / 8 + 1;
Expand Down
4 changes: 2 additions & 2 deletions gc/base/GCExtensionsBase.hpp
Expand Up @@ -379,7 +379,6 @@ class MM_GCExtensionsBase : public MM_BaseVirtual {

uintptr_t workpacketCount; /**< this value is ONLY set if -Xgcworkpackets is specified - otherwise the workpacket count is determined heuristically */
uintptr_t packetListSplit; /**< the number of ways to split packet lists, set by -XXgc:packetListLockSplit=, or determined heuristically based on the number of GC threads */
uintptr_t cacheListSplit; /**< the number of ways to split scanCache lists, set by -XXgc:cacheListLockSplit=, or determined heuristically based on the number of GC threads */

uintptr_t markingArraySplitMaximumAmount; /**< maximum number of elements to split array scanning work in marking scheme */
uintptr_t markingArraySplitMinimumAmount; /**< minimum number of elements to split array scanning work in marking scheme */
Expand Down Expand Up @@ -456,6 +455,7 @@ class MM_GCExtensionsBase : public MM_BaseVirtual {
bool scvTenureStrategyHistory; /**< Flag for enabling the History scavenger tenure strategy. */
bool scavengerEnabled;
bool scavengerRsoScanUnsafe;
uintptr_t cacheListSplit; /**< the number of ways to split scanCache lists, set by -XXgc:cacheListLockSplit=, or determined heuristically based on the number of GC threads */
#if defined(OMR_GC_CONCURRENT_SCAVENGER)
bool softwareRangeCheckReadBarrier; /**< enable software read barrier instead of hardware guarded loads when running with CS */
bool concurrentScavenger; /**< CS enabled/disabled flag */
Expand Down Expand Up @@ -1450,7 +1450,6 @@ class MM_GCExtensionsBase : public MM_BaseVirtual {
, useGCStartupHints(true)
, workpacketCount(0) /* only set if -Xgcworkpackets specified */
, packetListSplit(0)
, cacheListSplit(0)
, markingArraySplitMaximumAmount(DEFAULT_ARRAY_SPLIT_MAXIMUM_SIZE)
, markingArraySplitMinimumAmount(DEFAULT_ARRAY_SPLIT_MINIMUM_SIZE)
, rootScannerStatsEnabled(false)
Expand Down Expand Up @@ -1512,6 +1511,7 @@ class MM_GCExtensionsBase : public MM_BaseVirtual {
, scvTenureStrategyHistory(true)
, scavengerEnabled(false)
, scavengerRsoScanUnsafe(false)
, cacheListSplit(0)
#if defined(OMR_GC_CONCURRENT_SCAVENGER)
, softwareRangeCheckReadBarrier(false)
, concurrentScavenger(false)
Expand Down
2 changes: 2 additions & 0 deletions gc/verbose/VerboseHandlerOutput.cpp
Expand Up @@ -310,7 +310,9 @@ MM_VerboseHandlerOutput::handleInitialized(J9HookInterface** hook, uintptr_t eve
}

writer->formatAndOutput(env, 1, "<attribute name=\"packetListSplit\" value=\"%zu\" />", _extensions->packetListSplit);
#if defined(OMR_GC_MODRON_SCAVENGER)
writer->formatAndOutput(env, 1, "<attribute name=\"cacheListSplit\" value=\"%zu\" />", _extensions->cacheListSplit);
#endif /* OMR_GC_MODRON_SCAVENGER */
writer->formatAndOutput(env, 1, "<attribute name=\"splitFreeListSplitAmount\" value=\"%zu\" />", _extensions->splitFreeListSplitAmount);
writer->formatAndOutput(env, 1, "<attribute name=\"numaNodes\" value=\"%zu\" />", event->numaNodes);

Expand Down

0 comments on commit 6d5cab8

Please sign in to comment.