Skip to content

Commit

Permalink
Add reinitializeForRestore to GCExtBase
Browse files Browse the repository at this point in the history
Introduce reinitializeForRestore() method to GCExtBase, so that
during restore we can simply call this method rather than access
the GCExt members. This is done similar to other components which
need to reinit such as Configuration.

Also, add print in verboseGC for number of active cpus.

Signed-off-by: Frank Kang frank.kang@ibm.com
  • Loading branch information
kangyining committed Oct 5, 2023
1 parent c9cc0fe commit 18f006e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
8 changes: 8 additions & 0 deletions gc/base/GCExtensionsBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,14 @@ MM_GCExtensionsBase::computeDefaultMaxHeap(MM_EnvironmentBase* env)
memoryMax = MM_Math::roundToFloor(heapAlignment, (uintptr_t)memoryToRequest);
}

void
MM_GCExtensionsBase::reinitializeForRestore(MM_EnvironmentBase* env)
{
OMRPORT_ACCESS_FROM_OMRPORT(env->getPortLibrary());
usablePhysicalMemory = omrsysinfo_get_addressable_physical_memory();
parSweepChunkSize = 0;
}

bool
MM_GCExtensionsBase::isSATBBarrierActive()
{
Expand Down
2 changes: 1 addition & 1 deletion gc/base/GCExtensionsBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,7 @@ class MM_GCExtensionsBase : public MM_BaseVirtual {
virtual bool initialize(MM_EnvironmentBase* env);
virtual void tearDown(MM_EnvironmentBase* env);
virtual void computeDefaultMaxHeap(MM_EnvironmentBase* env);

virtual void reinitializeForRestore(MM_EnvironmentBase* env);
public:
static MM_GCExtensionsBase* newInstance(MM_EnvironmentBase* env);
virtual void kill(MM_EnvironmentBase* env);
Expand Down
1 change: 1 addition & 0 deletions gc/verbose/VerboseHandlerOutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,7 @@ MM_VerboseHandlerOutput::outputInitializedStanza(MM_EnvironmentBase *env, MM_Ver
buffer->formatAndOutput(env, 1, "<system>");
buffer->formatAndOutput(env, 2, "<attribute name=\"physicalMemory\" value=\"%llu\" />", omrsysinfo_get_physical_memory());
buffer->formatAndOutput(env, 2, "<attribute name=\"numCPUs\" value=\"%zu\" />", omrsysinfo_get_number_CPUs_by_type(OMRPORT_CPU_ONLINE));
buffer->formatAndOutput(env, 2, "<attribute name=\"numCPUs active\" value=\"%zu\" />", omrsysinfo_get_number_CPUs_by_type(OMRPORT_CPU_TARGET));
buffer->formatAndOutput(env, 2, "<attribute name=\"architecture\" value=\"%s\" />", omrsysinfo_get_CPU_architecture());
buffer->formatAndOutput(env, 2, "<attribute name=\"os\" value=\"%s\" />", omrsysinfo_get_OS_type());
buffer->formatAndOutput(env, 2, "<attribute name=\"osVersion\" value=\"%s\" />", omrsysinfo_get_OS_version());
Expand Down

0 comments on commit 18f006e

Please sign in to comment.