Skip to content

Commit 3e49f8f

Browse files
author
Thomas Schatzl
committed
8295839: G1: Single threaded phases (within parallel phases) report as using multiple threads in logs
Reviewed-by: ayang, iwalulya
1 parent 427f506 commit 3e49f8f

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

src/hotspot/share/gc/g1/g1RootProcessor.cpp

+9-13
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,14 @@ void G1RootProcessor::evacuate_roots(G1ParScanThreadState* pss, uint worker_id)
6262

6363
process_vm_roots(closures, phase_times, worker_id);
6464

65-
{
66-
// Now the CM ref_processor roots.
65+
// Now the CM ref_processor roots.
66+
if (_process_strong_tasks.try_claim_task(G1RP_PS_refProcessor_oops_do)) {
6767
G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::CMRefRoots, worker_id);
68-
if (_process_strong_tasks.try_claim_task(G1RP_PS_refProcessor_oops_do)) {
69-
// We need to treat the discovered reference lists of the
70-
// concurrent mark ref processor as roots and keep entries
71-
// (which are added by the marking threads) on them live
72-
// until they can be processed at the end of marking.
73-
_g1h->ref_processor_cm()->weak_oops_do(closures->strong_oops());
74-
}
68+
// We need to treat the discovered reference lists of the
69+
// concurrent mark ref processor as roots and keep entries
70+
// (which are added by the marking threads) on them live
71+
// until they can be processed at the end of marking.
72+
_g1h->ref_processor_cm()->weak_oops_do(closures->strong_oops());
7573
}
7674

7775
// CodeCache is already processed in java roots
@@ -186,11 +184,9 @@ void G1RootProcessor::process_java_roots(G1RootClosures* closures,
186184
closures->strong_codeblobs());
187185
}
188186

189-
{
187+
if (_process_strong_tasks.try_claim_task(G1RP_PS_ClassLoaderDataGraph_oops_do)) {
190188
G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::CLDGRoots, worker_id);
191-
if (_process_strong_tasks.try_claim_task(G1RP_PS_ClassLoaderDataGraph_oops_do)) {
192-
ClassLoaderDataGraph::roots_cld_do(closures->strong_clds(), closures->weak_clds());
193-
}
189+
ClassLoaderDataGraph::roots_cld_do(closures->strong_clds(), closures->weak_clds());
194190
}
195191
}
196192

0 commit comments

Comments
 (0)