RFR 8204947: Port ShenandoahTaskTerminator to mainline and make it default
zgu at redhat.com
zgu at redhat.com
Thu Dec 6 00:20:37 UTC 2018
> >
> > 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
Yeah, I was wondering if it was the only problem, probably you would
have noticed :-)
> .
>
> 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.
But for the worker that offered termination, it has to exit the
termination protocol to proceed. When it exits, it decreases
_offered_termination count, so when workers rendezvous,
_offered_termination should be zero, right?
>
> 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.
Great!
I incorporated all suggestions and the fixes.
http://cr.openjdk.java.net/~zgu/JDK-8204947/webrev.05/
Thanks,
-Zhengyu
>
> Thanks,
> Thomas
>
>
>
More information about the hotspot-gc-dev
mailing list