RFR: 8189276: Make SuspendibleThreadSet and related code available to other GCs

coleen.phillimore at oracle.com coleen.phillimore at oracle.com
Tue Oct 17 22:43:20 UTC 2017



On 10/17/17 5:34 PM, Roman Kennke wrote:
> Am 17.10.2017 um 23:10 schrieb Roman Kennke:
>>
>>> The SuspendibleThreadSet API for synchronizing any non-Java thread 
>>> with safepoints currently resides under gc/g1. It is very useful for 
>>> other GCs too (in particular, Shenandoah does use it too), so I 
>>> wanted to move it to a common location like gc/common. Then Kim 
>>> Barrett commented that it might actually be useful for other threads 
>>> outside GC land and to put it under runtime/. So I did:
>>>
>>> http://cr.openjdk.java.net/~rkennke/8189276/webrev.00/ 
>>> <http://cr.openjdk.java.net/%7Erkennke/8189276/webrev.00/>
>>>
>>> I also added a generic hook to call the STS from safepoint 
>>> sync/desync, which is consequently used by G1 now. In other words, 
>>> the CollectedHeap API that Erik Ö introduced is no longer used by 
>>> G1. Only CMS still uses that API because it has its own way to sync 
>>> with safepoints. I filed another bug 
>>> <https://bugs.openjdk.java.net/browse/JDK-8189364> for this. 
>>> Although I have my doubt it will ever be fixed. This seems to have 
>>> been very carefully evolved (to put it positive), and the risk of 
>>> breaking it is relatively high, and thus doesn't seem worth the 
>>> struggle to make it fit the STS.
>>>
>>> Issue:
>>> https://bugs.openjdk.java.net/browse/JDK-8189276
>>>
>>> What do you think? Ok to go in?
>>>
>> Replying to myself here.
>> I must admit that I am a bit reluctant to expose it to runtime/ 
>> unless there's a specific need for it. So maybe go back to the 
>> original plan to move it into gc/common and leave all the rest alone 
>> for now? What do others think?
>
> Sorry, forgot to add something. One reason why we originally wanted to 
> move it to gc/common (a new directory) instead of the existing 
> gc/shared was that Erik H objected that gc/shared would be built into 
> the minimal VM, and we probably wouldn't want that unless needed. 
> However, moving it to runtime/ (without actual need), would achieve 
> just that. So unless we can name an actual thread that would benefit 
> from synchronizing using the STS, I suggest to leave the STS code in 
> gc/common for now?
>
> That would be:
> http://cr.openjdk.java.net/~rkennke/8189276/webrev.01/ 
> <http://cr.openjdk.java.net/%7Erkennke/8189276/webrev.01/>
>
> Roman

Oh, please don't invent a directory for this.  It doesn't really matter 
that it's built into the minimal vm.  The minimal vm wasn't designed to 
be the strictly minimal set of things needed for small platforms, just 
smaller.  ie. that doesn't matter.

It seems like it should be gc/shared with things like taskqueue.

Thanks,
Coleen




More information about the hotspot-runtime-dev mailing list