RFR (XS) 8243291: Shenandoah: no need to retire TLABs at Init Update Refs

Roman Kennke rkennke at redhat.com
Tue Apr 21 17:56:19 UTC 2020


Nice find!

Looks good to me.

Roman


> RFE:
>   https://bugs.openjdk.java.net/browse/JDK-8243291
> 
> After JDK-8240872, we update URWM (update reference watermark) at final-mark, where we retire TLABs
> already. So we don't need to retire TLABs at Init Update Refs, because they are guaranteed to be
> past URWM. It used to be needed when we were capturing update-refs limit during init-update-refs.
> This patch saves about 1.5G of waste on 30G heap in a throwaway scenario for me.
> 
> diff -r 6fd1fbd073e2 src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp
> --- a/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp        Tue Apr 21 19:04:23 2020 +0200
> +++ b/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp        Tue Apr 21 19:46:05 2020 +0200
> @@ -1524,7 +1524,11 @@
>        assert_pinned_region_status();
>      }
> 
> -    // Force the threads to reacquire their TLABs outside the collection set.
> +    // Retire the TLABs, which will force threads to reacquire their TLABs after the pause.
> +    // This is needed for two reasons. Strong one: new allocations would be with new freeset,
> +    // which would be outside the collection set, so no cset writes would happen there.
> +    // Weaker one: new allocations would happen past update watermark, and so less work would
> +    // be needed for reference updates (would update the large filler instead).
>      {
>        ShenandoahGCSubPhase phase(ShenandoahPhaseTimings::retire_tlabs);
>        make_parsable(true);
> @@ -2449,10 +2453,6 @@
> 
>    {
>      ShenandoahGCSubPhase phase(ShenandoahPhaseTimings::init_update_refs_prepare);
> -
> -    make_parsable(true);
> -
> -    // Reset iterator.
>      _update_refs_iterator.reset();
>    }
> 
> 
> Testing: hotspot_gc_shenandoah {fastdebug,release}
> 



More information about the shenandoah-dev mailing list