Skip to content

Commit

Permalink
Follow up for initial SATB barrier changes
Browse files Browse the repository at this point in the history
Follow up for 2717. Removing redundant parameters and function calls
since openj9 changes are merged.

Signed-off-by: Evgenia Badyanova <[email protected]>
  • Loading branch information
Evgenia Badyanova committed Sep 20, 2018
1 parent feaf86d commit 48887c5
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 47 deletions.
18 changes: 0 additions & 18 deletions example/glue/ConcurrentMarkingDelegate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,24 +206,6 @@ class MM_ConcurrentMarkingDelegate
return true;
}


/**
* TODO SATB: remove later, renamed to signalThreadsToDeactivateWriteBarrier
* Once concurrent tracing has started, mutator threads must dirty cards at the appropriate
* write barrier(s) whenever a reference-value field is updated, until a GC cycle is started.
*/
MMINLINE bool signalThreadsToDirtyCards(MM_EnvironmentBase *env)
{
return true;
}

/**
* This can be used to optimize the concurrent write barrier(s) by conditioning threads to stop
* dirtying cards once a GC has started.
*/
MMINLINE void signalThreadsToStopDirtyingCards(MM_EnvironmentBase *env) { }


/**
* This can be used to optimize the concurrent write barrier(s) by conditioning threads to stop
* triggering barriers once a GC has started.
Expand Down
4 changes: 0 additions & 4 deletions gc/base/GCExtensionsBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ class MM_ObjectMap;
class MM_ReferenceChainWalkerMarkMap;
class MM_RememberedSetCardBucket;
#if defined(OMR_GC_STACCATO)
class MM_RememberedSetWorkPackets;
class MM_RememberedSetSATB;
#endif /* OMR_GC_STACCATO */
#if defined(OMR_GC_MODRON_SCAVENGER)
Expand Down Expand Up @@ -253,8 +252,6 @@ class MM_GCExtensionsBase : public MM_BaseVirtual {
MM_SublistPool rememberedSet;
#endif /* OMR_GC_MODRON_SCAVENGER */
#if defined(OMR_GC_STACCATO)
// TODO: SATB remove staccatoRememberedSet after initial SATB changes are merged
MM_RememberedSetWorkPackets* staccatoRememberedSet; /**< The Staccato remembered set used for the write barrier */
MM_RememberedSetSATB* sATBBarrierRememberedSet; /**< The snapshot at the beginning barrier remembered set used for the write barrier */
#endif /* OMR_GC_STACCATO */
ModronLnrlOptions lnrlOptions;
Expand Down Expand Up @@ -1235,7 +1232,6 @@ class MM_GCExtensionsBase : public MM_BaseVirtual {
, gcmetadataPageSize(0)
, gcmetadataPageFlags(OMRPORT_VMEM_PAGE_FLAG_NOT_USED)
#if defined(OMR_GC_STACCATO)
, staccatoRememberedSet(NULL)
, sATBBarrierRememberedSet(NULL)
#endif /* OMR_GC_STACCATO */

Expand Down
8 changes: 2 additions & 6 deletions gc/base/standard/ConcurrentGC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2214,9 +2214,7 @@ MM_ConcurrentGC::signalThreadsToActivateWriteBarrier(MM_EnvironmentBase *env)
reportGCCycleStart(env);
env->_cycleState = previousCycleState;

// TODO: SATB rename method to signalThreadsToActivateWriteBarrier
// _concurrentDelegate.signalThreadsToActivateWriteBarrier(env);
_concurrentDelegate.signalThreadsToDirtyCards(env);
_concurrentDelegate.signalThreadsToActivateWriteBarrier(env);
_stats.switchExecutionMode(CONCURRENT_INIT_COMPLETE, CONCURRENT_ROOT_TRACING);
/* Cancel any outstanding call backs on other threads as this thread has done the necessary work */
_callback->cancelCallback(env);
Expand Down Expand Up @@ -3146,9 +3144,7 @@ MM_ConcurrentGC::internalPostCollect(MM_EnvironmentBase *env, MM_MemorySubSpace
if (_extensions->optimizeConcurrentWB) {
/* Reset vmThread flag so mutators don't dirty cards until next concurrent KO */
if (_stats.getExecutionModeAtGC() > CONCURRENT_INIT_RUNNING) {
// TODO: SATB change rename method to signalThreadsToDeactivateWriteBarrier
// _concurrentDelegate.signalThreadsToDeactivateWriteBarrier(env);
_concurrentDelegate.signalThreadsToStopDirtyingCards(env);
_concurrentDelegate.signalThreadsToDeactivateWriteBarrier(env);
}

/* Cancel any outstanding call backs */
Expand Down
2 changes: 1 addition & 1 deletion gc/base/standard/RememberedSetSATB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ MM_RememberedSetSATB::newInstance(MM_EnvironmentBase *env, MM_WorkPacketsSATB *w
}

/**
* Kill the RememberedSetWorkPackets instance
* Kill the MM_RememberedSetSATB instance
*/
void
MM_RememberedSetSATB::kill(MM_EnvironmentBase *env)
Expand Down
20 changes: 6 additions & 14 deletions gc/base/standard/WorkPacketsSATB.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/*******************************************************************************
* Copyright (c) 2018, 2018 IBM Corp. and others
*
Expand Down Expand Up @@ -28,8 +27,8 @@
#include "WorkPacketsSATB.hpp"

#include "Debug.hpp"
#include "GCExtensions.hpp"
#include "IncrementalOverflow.hpp"
#include "GCExtensionsBase.hpp"
#include "OverflowStandard.hpp"

/**
* Instantiate a MM_WorkPacketsSATB
Expand Down Expand Up @@ -64,17 +63,10 @@ MM_WorkPacketsSATB::initialize(MM_EnvironmentBase *env)
return false;
}

if (0 == MM_GCExtensions::getExtensions(_extensions)->overflowCacheCount) {
/* If the user has not specified a value for overflowCacheCount
* set it to be 5% of the packet slot count.
*/
MM_GCExtensions::getExtensions(_extensions)->overflowCacheCount = (UDATA)(_slotsInPacket * 0.05);
}

if (!_inUseBarrierPacketList.initialize(env)) {
return false;
}

return true;
}

Expand All @@ -95,7 +87,7 @@ MM_WorkPacketsSATB::tearDown(MM_EnvironmentBase *env)
MM_WorkPacketOverflow *
MM_WorkPacketsSATB::createOverflowHandler(MM_EnvironmentBase *env, MM_WorkPackets *wp)
{
return MM_IncrementalOverflow::newInstance(env, wp);
return MM_OverflowStandard::newInstance(env, wp);
}

/**
Expand Down Expand Up @@ -204,7 +196,7 @@ MM_WorkPacketsSATB::moveInUseToNonEmpty(MM_EnvironmentBase *env)
float
MM_WorkPacketsSATB::getHeapCapacityFactor(MM_EnvironmentBase *env)
{
/* Increase the factor for staccato since more packets are required */
/* Increase the factor for SATB barrier since more packets are required */
return (float)0.008;
}

Expand All @@ -218,7 +210,7 @@ MM_WorkPacketsSATB::getInputPacketFromOverflow(MM_EnvironmentBase *env)
{
MM_Packet *overflowPacket;

/* Staccato spec cannot loop here as all packets may currently be on
/* SATB spec cannot loop here as all packets may currently be on
* the InUseBarrierList. If all packets are on the InUseBarrierList then this
* would turn into an infinite busy loop.
* while(!_overflowHandler->isEmpty()) {
Expand Down
6 changes: 2 additions & 4 deletions include_core/omrgcconsts.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,9 @@ typedef enum MM_GCPolicy {
#define OMR_GC_WRITE_BARRIER_TYPE_CARDMARK 0x4
#define OMR_GC_WRITE_BARRIER_TYPE_CARDMARK_INCREMENTAL 0x5
#define OMR_GC_WRITE_BARRIER_TYPE_CARDMARK_AND_OLDCHECK 0x6
#define OMR_GC_WRITE_BARRIER_TYPE_REALTIME 0x7
#define OMR_GC_WRITE_BARRIER_TYPE_SATB 0x7
#define OMR_GC_WRITE_BARRIER_TYPE_COUNT 0x8
#define OMR_GC_WRITE_BARRIER_TYPE_SATB_AND_OLDCHECK 0x9
#define OMR_GC_WRITE_BARRIER_TYPE_SATB_AND_OLDCHECK 0x8
#define OMR_GC_WRITE_BARRIER_TYPE_COUNT 0x9

#define OMR_GC_READ_BARRIER_TYPE_ILLEGAL 0x0
#define OMR_GC_READ_BARRIER_TYPE_NONE 0x1
Expand All @@ -79,7 +78,6 @@ typedef enum MM_GCWriteBarrierType {
gc_modron_wrtbar_cardmark_and_oldcheck = OMR_GC_WRITE_BARRIER_TYPE_CARDMARK_AND_OLDCHECK,
gc_modron_wrtbar_satb = OMR_GC_WRITE_BARRIER_TYPE_SATB,
gc_modron_wrtbar_satb_and_oldcheck = OMR_GC_WRITE_BARRIER_TYPE_SATB_AND_OLDCHECK,
gc_modron_wrtbar_realtime = OMR_GC_WRITE_BARRIER_TYPE_SATB,
gc_modron_wrtbar_count = OMR_GC_WRITE_BARRIER_TYPE_COUNT
} MM_GCWriteBarrierType;

Expand Down

0 comments on commit 48887c5

Please sign in to comment.