RFR: 8231672: Simplify the reference processing parallelization framework
Leo Korinth
lkorinth at openjdk.java.net
Fri Mar 5 16:04:07 UTC 2021
On Thu, 4 Mar 2021 09:35:32 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:
>> With the change of parallel gc to use the same workgang implementation that other gcs uses, it is possible to remove the abstraction used to hide different worker thread management implementations (TaskExecutor).
>>
>> At the same time as removing the TaskExecutor, also remove part of the special casing (mostly code duplication), for single threaded execution.
>>
>> I consider the new method `prepare_run_task` that modifies the state of the context a step backwards from what was. However, I think removing the Executor with its proxy-tasks and removing separate code paths for serial execution makes the change worth this step back. We also removes ~270 lines of code.
>>
>> Some comments:
>> 1) I use references in some places where they can replace pointers. I could go much further here, but I did not want to bloat the pull request, maybe later change all closures to be references as well? Should I create enhancements for this?
>>
>> 2) I added an enum class ThreadModel instead of using a boolean, this could also be used in many more places. I dislike sending lots of bools with a comment like `true /* _is_mt */`. It also adds type safety if a method takes many bools. However, with this limited change, and not many hard-coded bools, it feels a bit overkill and I am willing to remove the enum, what do you think?
>>
>> Testing:
>> hotspot_gc and tier 1-3 has passed earlier versions before minor cleanups. I intend to re-run tests after review changes.
>
> src/hotspot/share/gc/g1/g1CollectedHeap.cpp line 3317:
>
>> 3315: class G1STWRefProcClosureContext : public AbstractClosureContext {
>> 3316: uint _max_workers;
>> 3317: uint _queues;
>
> Please avoid lining up member names. That is hard to read. Group them by functionality/contents.
Agree, will remove all spaces.
> src/hotspot/share/gc/g1/g1CollectedHeap.cpp line 3354:
>
>> 3352:
>> 3353: BoolObjectClosure* is_alive(uint worker_id) { return &_is_alive; }
>> 3354: OopClosure* keep_alive(uint worker_id) {
>
> Newline between definitions.
Will fix.
> src/hotspot/share/gc/shared/referenceProcessor.cpp line 200:
>
>> 198:
>> 199: ReferenceProcessorStats ReferenceProcessor::process_discovered_references(
>> 200: AbstractClosureContext& closure_context,
>
> Please fix indendation of parameters according to Hotspot style.
Will fix.
> src/hotspot/share/gc/g1/g1CollectedHeap.cpp line 3331:
>
>> 3329: public:
>> 3330: G1STWRefProcClosureContext(
>> 3331: uint max_workers,
>
> Parameter indentation.
will fix.
-------------
PR: https://git.openjdk.java.net/jdk/pull/2782
More information about the hotspot-gc-dev
mailing list