-
Enhancement
-
Resolution: Fixed
-
P4
-
11-shenandoah, 14, 15
-
b15
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8243426 | 14.0.2 | Zhengyu Gu | P4 | Resolved | Fixed | b04 |
We can avoid to scan thread code roots if we scan all code roots.
diff -r a6c70ccaa775 src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.inline.hpp
--- a/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.inline.hpp Thu Mar 12 09:23:05 2020 +0900
+++ b/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.inline.hpp Wed Mar 11 21:50:02 2020 -0400
@@ -226,7 +226,6 @@
!ShenandoahHeap::heap()->unload_classes() ||
ShenandoahHeap::heap()->is_traversal_mode(),
"Expect class unloading or traversal when Shenandoah cycle is running");
- ShenandoahParallelOopsDoThreadClosure tc_cl(oops, code, tc);
ResourceMark rm;
_serial_roots.oops_do(oops, worker_id);
@@ -238,13 +237,16 @@
assert(ShenandoahHeap::heap()->is_concurrent_traversal_in_progress(), "Only possible with traversal GC");
}
- _thread_roots.threads_do(&tc_cl, worker_id);
-
// With ShenandoahConcurrentScanCodeRoots, we avoid scanning the entire code cache here,
// and instead do that in concurrent phase under the relevant lock. This saves init mark
// pause time.
if (code != NULL && !ShenandoahConcurrentScanCodeRoots) {
_code_roots.code_blobs_do(code, worker_id);
+ ShenandoahParallelOopsDoThreadClosure tc_cl(oops, NULL, tc);
+ _thread_roots.threads_do(&tc_cl, worker_id);
+ } else {
+ ShenandoahParallelOopsDoThreadClosure tc_cl(oops, code, tc);
+ _thread_roots.threads_do(&tc_cl, worker_id);
}
diff -r a6c70ccaa775 src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.inline.hpp
--- a/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.inline.hpp Thu Mar 12 09:23:05 2020 +0900
+++ b/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.inline.hpp Wed Mar 11 21:50:02 2020 -0400
@@ -226,7 +226,6 @@
!ShenandoahHeap::heap()->unload_classes() ||
ShenandoahHeap::heap()->is_traversal_mode(),
"Expect class unloading or traversal when Shenandoah cycle is running");
- ShenandoahParallelOopsDoThreadClosure tc_cl(oops, code, tc);
ResourceMark rm;
_serial_roots.oops_do(oops, worker_id);
@@ -238,13 +237,16 @@
assert(ShenandoahHeap::heap()->is_concurrent_traversal_in_progress(), "Only possible with traversal GC");
}
- _thread_roots.threads_do(&tc_cl, worker_id);
-
// With ShenandoahConcurrentScanCodeRoots, we avoid scanning the entire code cache here,
// and instead do that in concurrent phase under the relevant lock. This saves init mark
// pause time.
if (code != NULL && !ShenandoahConcurrentScanCodeRoots) {
_code_roots.code_blobs_do(code, worker_id);
+ ShenandoahParallelOopsDoThreadClosure tc_cl(oops, NULL, tc);
+ _thread_roots.threads_do(&tc_cl, worker_id);
+ } else {
+ ShenandoahParallelOopsDoThreadClosure tc_cl(oops, code, tc);
+ _thread_roots.threads_do(&tc_cl, worker_id);
}
- backported by
-
JDK-8243426 Shenandoah: Avoid scanning thread code roots twice in all root scanner
-
- Resolved
-