Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8189276

Make SuspendibleThreadSet and related code available to other GCs

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 10
    • Fix Version/s: 10
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
      gc
    • Resolved In Build:
      b31
    • CPU:
      generic
    • OS:
      generic

      Description

      SuspendibleThreadSet is used in G1 to allow GC threads to participate in safepointing. It seems very useful for other GCs too and should be made available in a shared source directory.

        Issue Links

          Activity

          Hide
          kbarrett Kim Barrett added a comment - - edited
          Should it be made more general even than just available to other GCs? It seems like there are other (possible) threads that might want some similar mechanism. That is, maybe this facility belongs in runtime rather than in (say) gc/shared. Though if we're going to do that, probably the API should be somewhere other than on the heap, as is being done by JDK-8188919.
          Show
          kbarrett Kim Barrett added a comment - - edited Should it be made more general even than just available to other GCs? It seems like there are other (possible) threads that might want some similar mechanism. That is, maybe this facility belongs in runtime rather than in (say) gc/shared. Though if we're going to do that, probably the API should be somewhere other than on the heap, as is being done by JDK-8188919 .
          Hide
          rkennke Roman Kennke added a comment -
          I believe this should be possible. The API can be made available anywhere, e.g. in SafepointSynchronize or directly in STS (in addition to the heap API, which also supports CMS and ParallelGC which are not (yet) using the STS mechanism).
          Show
          rkennke Roman Kennke added a comment - I believe this should be possible. The API can be made available anywhere, e.g. in SafepointSynchronize or directly in STS (in addition to the heap API, which also supports CMS and ParallelGC which are not (yet) using the STS mechanism).
          Hide
          kbarrett Kim Barrett added a comment - - edited
          ParallelGC doesn't need this; it doesn't have threads running concurrently with the mutator that need to be stopped for a safepoint. I think CMS ought to be changed to use STS rather than it's own thing.
          Show
          kbarrett Kim Barrett added a comment - - edited ParallelGC doesn't need this; it doesn't have threads running concurrently with the mutator that need to be stopped for a safepoint. I think CMS ought to be changed to use STS rather than it's own thing.
          Hide
          rkennke Roman Kennke added a comment -
          Right. This goes a little out of scope for this issue though. I propose to move the STS code to runtime/ under this ID, then add the general STS hooks to safepoint.cpp under JDK-8188919 (thereby making G1 use that, and keep the heap 'API' for CMS only), and file a new issue to make CMS use STS (I tried that before... this is far from trivial), at which point we can ditch the heap suspend/resume API again. Sounds good?
          Show
          rkennke Roman Kennke added a comment - Right. This goes a little out of scope for this issue though. I propose to move the STS code to runtime/ under this ID, then add the general STS hooks to safepoint.cpp under JDK-8188919 (thereby making G1 use that, and keep the heap 'API' for CMS only), and file a new issue to make CMS use STS (I tried that before... this is far from trivial), at which point we can ditch the heap suspend/resume API again. Sounds good?
          Hide
          kbarrett Kim Barrett added a comment -
          [~rkennke] That plan sounds fine, although I think a different RFE from JDK-8188919 will be needed for generalization of the STS hooks away from the heap object, unless you are planning to redirect that RFE. I mostly want to avoid moving STS first to gc/shared and then later to runtime/. And I agree that changing CMS to use STS is unfortunately not trivial. And might never happen, since CMS has been deprecated and doesn't seem to be receiving a lot of attention.
          Show
          kbarrett Kim Barrett added a comment - [~rkennke] That plan sounds fine, although I think a different RFE from JDK-8188919 will be needed for generalization of the STS hooks away from the heap object, unless you are planning to redirect that RFE. I mostly want to avoid moving STS first to gc/shared and then later to runtime/. And I agree that changing CMS to use STS is unfortunately not trivial. And might never happen, since CMS has been deprecated and doesn't seem to be receiving a lot of attention.
          Hide
          rkennke Roman Kennke added a comment -
          Ah sorry, I only now understood that JDK-8188919 is the one that Erik Ö. is currently working on.

          I can also add the generic STS hooks under this RFE, if you don't object? I.e. 1. move STS to runtime/ *and* also add the hooks and make G1 use those.

          I'll take another shot at CMS safepoint de/sync too.
          Show
          rkennke Roman Kennke added a comment - Ah sorry, I only now understood that JDK-8188919 is the one that Erik Ö. is currently working on. I can also add the generic STS hooks under this RFE, if you don't object? I.e. 1. move STS to runtime/ *and* also add the hooks and make G1 use those. I'll take another shot at CMS safepoint de/sync too.
          Hide
          hgupdate HG Updates added a comment -
          URL: http://hg.openjdk.java.net/jdk10/hs/rev/64dba69fc528
          User: coleenp
          Date: 2017-10-18 21:08:46 +0000
          Show
          hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk10/hs/rev/64dba69fc528 User: coleenp Date: 2017-10-18 21:08:46 +0000
          Hide
          hgupdate HG Updates added a comment -
          URL: http://hg.openjdk.java.net/jdk10/master/rev/64dba69fc528
          User: jwilhelm
          Date: 2017-11-04 02:58:06 +0000
          Show
          hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk10/master/rev/64dba69fc528 User: jwilhelm Date: 2017-11-04 02:58:06 +0000

            People

            • Assignee:
              rkennke Roman Kennke
              Reporter:
              rkennke Roman Kennke
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: