Skip to content

ConcurrentGC Refactoring & SATB Tuning Methods - #5889

Merged
0xdaryl merged 1 commit into
eclipse-omr:masterfrom
RSalman:satb-refactor
Nov 8, 2021
Merged

0xdaryl merged 1 commit into
eclipse-omr:masterfrom
RSalman:satb-refactor

Conversation

@RSalman

@RSalman RSalman commented Apr 1, 2021 •

Copy link
Copy Markdown

These changes are to generalize the ConcurrentGC Collector so that it can be used for both: IncrementalUpdate and SATB style of Concurrent Marking. They are a pre-req to introducing SATB since the existing concurrent collector class is closely tied to the Incremental Update approach.

CM enabling functionality needs to be abstracted - card table/cleaning cards must be extracted to the derived IncrementalUpdate class. Because that there hasn't been any other implementation prior to SATB, ConcurrentGC has acted as an Concurrent Incremental Update Collector, much of the components (e.g state machine, Initing, Tuning/adaptive parameters, concurrent state/phases, verbose logging, etc) can be reused with this rework.

  • ConcurrentGC class is now an Abstract Class (removed newInstance function and introduced pure virtual functions)

  • Card cleaning specific adaptive params/factors moved to Incremental Update

  • Common (Generalized) logic & vars given Protected access in Concurrent GC

  • New methods introduced to help common up shared logic (e.g., initalizeConcurrentStructures, doConcurrentInitializationInternal, updateTuningStatisticsInternal etc)

  • New WB API specifically for PostStore: concurrentPostWriteBarrierStore

    • Meant to replace existing APIs: J9ConcurrentWriteBarrierBatchStore & J9ConcurrentWriteBarrierStore
    • Existing APIs are marked deprecated - they simply call the new API

Tuning logic Implemented for SATB (borrows Incremental logic and simplifies it by not considering 2 pass and cards)

  • adjustTraceTarget
  • tuneToHeap

Signed-off-by: Salman Rana salman.rana@ibm.com

@RSalman RSalman changed the title WIP: ConcurrentGC Refactoring Marking & SATB Tuning Method Implementations WIP: ConcurrentGC Refactoring Marking & SATB Tuning Apr 1, 2021
@RSalman RSalman changed the title WIP: ConcurrentGC Refactoring Marking & SATB Tuning WIP: ConcurrentGC Refactoring & SATB Tuning Apr 1, 2021
@RSalman RSalman changed the title WIP: ConcurrentGC Refactoring & SATB Tuning WIP: ConcurrentGC Refactoring & SATB Tuning Methods Apr 1, 2021
@RSalman

RSalman commented Apr 1, 2021

Copy link
Copy Markdown
Author

Much of ConcurrentGCSATB.cpp needs implementation, SATB patches (from #5494) can be brought in following these changes. Only thing new in ConcurrentGCSATB.cpp is:

  • adjustTraceTarget
  • tuneToHeap

@RSalman

RSalman commented Apr 1, 2021 •

Copy link
Copy Markdown
Author

There's still some (~4) references to cards in Base class, it wasn't worth taking out these, these operations are simply guarded to ensure the code is executed only for Incremental: e.g..,

/* If the segment is for a concurrently collectable subspace we will * have some cards to clear too */
if ((subspace->isConcurrentCollectable()) && (_extensions->configuration->isIncrementalUpdateBarrierEnabled())) {
    _numInitRanges += 2; /* We will have some cards to clean as well */
} else {
    _numInitRanges += 1;
}
if (!_initSetupDone ) {
	_markingScheme->getWorkPackets()->reset(env);
	_markingScheme->workerSetupForGC(env);
	if(NULL != _cardTable) {
		((MM_ConcurrentCardTable *)_cardTable)->initializeCardCleaning(env);
	}
	_initSetupDone = true;
}

Edit: This no longer applies with the latest changes

@RSalman

RSalman commented Apr 1, 2021

Copy link
Copy Markdown
Author

cc @amicic @dmitripivkine

@RSalman
RSalman marked this pull request as ready for review April 1, 2021 22:00
@RSalman
RSalman force-pushed the satb-refactor branch 2 times, most recently from 91b7fa8 to 1f0b410 Compare May 17, 2021 18:52
Comment thread gc/base/standard/ConcurrentGC.cpp Resolved
Comment thread gc/base/standard/ConcurrentGCSATB.cpp Resolved
@RSalman
RSalman force-pushed the satb-refactor branch 3 times, most recently from 3ce3cfe to 5d3536a Compare June 28, 2021 21:00
@RSalman

RSalman commented Jun 28, 2021 •

Copy link
Copy Markdown
Author

Latest commit removes Card Table references in the base class ConcurrentGC.

I'm still going through it to verify that the changes have been refactored correctly and still testing these changes.

@RSalman
RSalman force-pushed the satb-refactor branch 8 times, most recently from 0097b7a to 5e08f17 Compare June 29, 2021 03:36
Comment thread gc/base/standard/ConcurrentGC.cpp Resolved
Comment thread gc/base/standard/ConcurrentGCSATB.cpp Resolved
Comment thread gc/base/standard/ConcurrentGCSATB.cpp Resolved
@RSalman
RSalman force-pushed the satb-refactor branch 2 times, most recently from ffe20c4 to 011c9ad Compare November 3, 2021 21:32
@0xdaryl

0xdaryl commented Nov 4, 2021

Copy link
Copy Markdown
Contributor

Jenkins build all

@0xdaryl

0xdaryl commented Nov 4, 2021

Copy link
Copy Markdown
Contributor

Bah. I didn't notice the earlier CI build failures before launching Jenkins build. Please fix.

@RSalman
RSalman force-pushed the satb-refactor branch 2 times, most recently from adcfbca to ea30e4f Compare November 4, 2021 16:05
@RSalman RSalman changed the title ConcurrentGC Refactoring & SATB Tuning Methods [WIP] ConcurrentGC Refactoring & SATB Tuning Methods Nov 4, 2021
@RSalman

RSalman commented Nov 4, 2021

Copy link
Copy Markdown
Author

Fixed the previous compile issue, looking into the test failure now

@RSalman

RSalman commented Nov 5, 2021 •

Copy link
Copy Markdown
Author

Turns out the issue was from changing I_32 to uint32_t:

+ for (uint32_t x = (initIndex - 1); x >= 0; x--)  

correct conversion is signed int32 int32_t.

Everything else looks good, I'll clean up commit history and this should be good to merge

@RSalman
RSalman force-pushed the satb-refactor branch 2 times, most recently from c33f6f4 to ae8ce9f Compare November 6, 2021 03:35
These changes are to generalize the ConcurrentGC Collector Class so that
it can be used for both IncrementalUpdate and SATB style of Concurrent
Marking. They are a pre-req to introducing SATB since the existing
concurrent collector class is closely tied to Incremental Update
approach. CM enabling functionality needs to be abstracted - card
table/cleaning cards must be extracted to the derived IncrementalUpdate
class. Since there hasn't been any other implementation prior to SATB,
ConcurrentGC has acted as Incremental Update Concurrent Collector, much
of the components (e.g state machine, Initing, Tuning/adaptive
parameters, concurrent state/phases, verbose logging, etc) can be reused
with this rework by extracting card/barrier specific code.

- ConcurrentGC class is now an Abstract Class _(removed newInstance
function)_
- Card cleaning specific adaptive params/factors moved to Incremental
Update
- Common (Generalized) logic & vars given Protected access in Concurrent
GC
- New methods introduced to help common up shared logic
  - signalThreadsToActivateWriteBarrierInternal
  - updateTuningStatisticsInternal
  - resetConcurrentParameters
  - preCompleteConcurrentCycle
  - finalConcurrentPrecollect
  - getTraceTarget

- External WB Entry points now call new collector specific handlers
  - J9ConcurrentWriteBarrierBatchStoreHandler
  - J9ConcurrentWriteBarrierStoreHandler

**Tuning logic Implemented for SATB**
- adjustTraceTarget
- tuneToHeap

Signed-off-by: Salman Rana <salman.rana@ibm.com>
@RSalman RSalman changed the title [WIP] ConcurrentGC Refactoring & SATB Tuning Methods ConcurrentGC Refactoring & SATB Tuning Methods Nov 6, 2021
@0xdaryl

0xdaryl commented Nov 8, 2021

Copy link
Copy Markdown
Contributor

Jenkins build all

@0xdaryl 0xdaryl self-assigned this Nov 8, 2021

@0xdaryl 0xdaryl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Windows CI failure occurred after tests were run successfully.

@0xdaryl
0xdaryl merged commit 3b8319a into eclipse-omr:master Nov 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants