RFR: JDK-8220671: Initialization race for non-JavaThread PtrQueues

Kim Barrett kim.barrett at oracle.com
Mon Apr 1 19:16:23 UTC 2019


> On Apr 1, 2019, at 4:37 AM, Per Liden <per.liden at oracle.com> wrote:
> 
> Hi Kim,
> 
> On 4/1/19 9:21 AM, Kim Barrett wrote:
>> Here's the updated patch:
>> full: http://cr.openjdk.java.net/~kbarrett/8220671/open.01/
>> incr: http://cr.openjdk.java.net/~kbarrett/8220671/open.01.inc/
>> (The incremental patch might not be that interesting compared to the
>> full patch.)
>> The incremental patch adds a new mutex for the NJT synchronizer's
>> synchronize(). It also adjusts and/or moves around some comments. And
>> it adds ZGC code to protect against the same issue. I'm not sure the
>> ZGC code is in the right place (ZHeap); maybe it should be in
>> ZAddressMask instead? I'll let Per comment on that.
> 
> I think we can/should skip the locking in ZGC all together, as it doesn't actually allow a concurrent GC thread to use it's thread local mask anyway, without also having such threads participate in the STS. Since they don't do that today, locking here is unnecessary and might just give the impression it's safe.

Will do.

> Other than that, I think the patch looks good. I don't need a new webrev if you just remove the ZGC locking.

Thanks.

> cheers,
> Per
> 
>> Testing: mach5 tier1-5.  I couldn't think of a good way to make a real
>> regression test here, because it's so timing sensitive.





More information about the hotspot-gc-dev mailing list