RFR: 8209850: Allow NamedThreads to use GlobalCounter critical sections

Kim Barrett kim.barrett at oracle.com
Thu Aug 23 18:39:24 UTC 2018


> On Aug 23, 2018, at 3:17 AM, Robbin Ehn <robbin.ehn at oracle.com> wrote:
> 
> Great stuff, thanks Kim!
> 
> But I strongly suggest keeping the three volatiles in SingleWriterSynchronizer on separate cache-lines. Specially _enter and _exit. I don't expect many of these and so I don't care about footprint. Am I wrong?

I agree there aren't expected to be many of these.  OTOH, those that
we know about are not ultra performance critical either.  So the
uglification of the code to microoptimize it seems unnecessary to me.
This can be revisited if present assumptions change and we have
measurements to show it matters.

> Thanks, Robbin
> 
> On 2018-08-22 21:18, Kim Barrett wrote:
>> Please review this change to GlobalCounter, permitting NamedThreads to
>> enter a critical section.
>> To accomplish this, we add a new RCU-inspired synchronization utility,
>> SingleWriterSynchronizer.  This has some similarities to
>> GlobalCounter, but the latter should be preferred except where it
>> can't be used (such as in the implementation of GlobalCounter!).  This
>> utility is based on a private utility embedded in OopStorage.  That
>> private utility is being replaced by the new public one.
>> Using this new synchronization utility, we provide lock-free iteration
>> over the list of NamedThreads that is safe against creation and
>> deletion of such threads.  That iteration is used by GlobalCounter to
>> examine all NamedThreads, rather than only the VMThread.
>> CR:
>> https://bugs.openjdk.java.net/browse/JDK-8209850
>> Webrev:
>> http://cr.openjdk.java.net/~kbarrett/8209850/open.00/
>> Testing:
>> mach5 tier1-3, hs-tier4-5.
>> New synchronization utility includes a gtest.




More information about the hotspot-dev mailing list