RFR 8204947: Port ShenandoahTaskTerminator to mainline and make it default
Thomas Schatzl
thomas.schatzl at oracle.com
Wed Dec 5 21:26:29 UTC 2018
Hi,
On Wed, 2018-12-05 at 13:43 -0500, zgu at redhat.com wrote:
> Hi Thomas,
>
>
> > However, when trying this out I rarely get an assertion failure in
> > taskqueue.cpp:234.
> >
>
> Ha, this indeed my bug, could you try following patch? or I can
> generate new webrev.
>
> diff -r 26bd32dafb9b
> src/hotspot/share/gc/shared/owstTaskTerminator.cpp
> --- a/src/hotspot/share/gc/shared/owstTaskTerminator.cpp Wed
> Dec
> 05 10:12:32 2018 -0500
> +++ b/src/hotspot/share/gc/shared/owstTaskTerminator.cpp Wed
> Dec
> 05 13:40:00 2018 -0500
> @@ -37,6 +37,7 @@
>
> // Single worker, done
> if (_n_threads == 1) {
> + _offered_termination = 1;
> return true;
> }
>
yes, that's an issue, but does not fix the real problem. It also
occurs with multiple threads.
Basically for that assert to work, all threads *must* offer termination
at some point. G1 code does not guarantee that. It can completely pass
over the offer_termination call by setting a bool flag in many places.
Other uses of the terminator just re-instantiate the terminator for
every use, automatically avoiding this issue.
To avoid rewriting too much of G1 code (I would prefer it would too
just re-instantiate everything needed for every marking cycle) let's
stay with your latest version with the assignment operator being a
move.
I will look at it tomorrow at the latest webrev in detail again, but I
think it is good.
Thanks,
Thomas
More information about the hotspot-gc-dev
mailing list