RFR: Shortcut reference processing when no work is available
Aleksey Shipilev
shade at redhat.com
Tue Jun 6 17:54:27 UTC 2017
Shenandoah has parallel reference processing enabled by default.
Current RP implementation submits the processing task to the supplied executor,
in hope that parallelism would be beneficial. However, in many cases, either the
lists of references is empty, or the number of actual references is zero (e.g.
after precleaning), or the number of references falls to zero in the following
phases.
This makes RP start the executor task, even if we know there is no work. We
would then waste time waiting for threads to wake up, discover there is no work,
rendezvous and terminate.
While there is the potential upstream work [1] that can solve the issue
completely for smaller number of tasks, we can handle the corner case of zero
tasks in current Shenandoah:
1) Shortcut with has_discovered_references() in precleaning and weakrefs_work;
2) Shortcut in the Shenandoah-specific RP task;
http://cr.openjdk.java.net/~shade/shenandoah/refproc-shortcut-empty/webrev.01/
These two improvements trim down the weak ref processing time significantly,
even on small desktop:
http://cr.openjdk.java.net/~shade/shenandoah/refproc-shortcut-empty/before.txt
http://cr.openjdk.java.net/~shade/shenandoah/refproc-shortcut-empty/after.txt
Thanks,
-Aleksey
[1] https://bugs.openjdk.java.net/browse/JDK-8043575
More information about the shenandoah-dev
mailing list