Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scan Queue splitting defaults #4780

Merged
merged 1 commit into from
Jan 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 9 additions & 17 deletions gc/base/Configuration.cpp
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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