RFR: 8219613: Use NonJavaThread PtrQueues

Kim Barrett kim.barrett at oracle.com
Tue Feb 26 03:27:38 UTC 2019

Please review this change to G1 and Shenandoah to use the already
extent thread-local PtrQueues in NonJavaThreads, rather than using
shared queues that require locking.

This is a step toward addressing JDK-8209974, JDK-8173211, and

There are several parts to the change:

The existing BarrierSet::on_thread_(attach|detach) functions get
extended to apply to and be called for all threads, not just Java
threads.  A few implementations need to limit some of their behavior
to Java threads, but others can just apply most or all of their
existing behavior to non-Java threads too.  This includes ZGC.

Most operations involving shared queues are now applied to the
corresponding thread-local queue, irrespective of whether the thread
is a Java thread or not.  Previously, a non-Java thread had to use the
appropriate shared queue.

Various iterations over threads get expanded to apply to all threads,
rather than only Java threads.

This change eliminates the single shared SATB queue and the associated
(access-rank) lock.  It does not eliminate the shared dirty card
queues, as there is one use that can't be switched to using the
thread-local queue.  Because of that, the support for shared queues in
PtrQueue (_lock and _permanent members and associated behavior) is
still needed too.  I have more changes in progress to address that.



gc/shared/barrierSet.cpp is in the webrev, but ended up not being changed.

I'll update copyrights before pushing.

Shenandoah changes provided with the help of Aleksey Shipilev.

mach5 tier1-3, hs-tier4-5
jtreg: hotspot_gc_shenandoah

More information about the hotspot-gc-dev mailing list