RFR: 8294775: Shenandoah: reduce contention on _threads_in_evac

Nick Gasson ngasson at openjdk.org
Wed Oct 5 11:20:53 UTC 2022


On Wed, 5 Oct 2022 11:10:29 GMT, Nick Gasson <ngasson at openjdk.org> wrote:

> The idea here is to reduce contention on the shared `_threads_in_evac` counter by splitting its state over multiple independent cache lines. Each thread hashes to one particular counter based on its `Thread*`. This helps improve throughput of concurrent evacuation where many Java threads may be attempting to update this counter on the load barrier slow path.
> 
> See this earlier thread for details and SPECjbb results: https://mail.openjdk.org/pipermail/shenandoah-dev/2022-October/017494.html
> 
> Also tested `hotspot_gc_shenandoah` on x86 and AArch64.

src/hotspot/share/gc/shenandoah/shenandoahEvacOOMHandler.inline.hpp line 35:

> 33: 
> 34: void ShenandoahEvacOOMHandler::enter_evacuation(Thread* thr) {
> 35:   jint threads_in_evac = Atomic::load_acquire(&_threads_in_evac);

This load seems to be redundant. I don't think it has any ordering effects and we will load it again immediately either below or in `register_thread()`.

-------------

PR: https://git.openjdk.org/jdk/pull/10573


More information about the shenandoah-dev mailing list