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

Remove on-stack nmethod hotness counter sampling from safepoints



    • Enhancement
    • Status: Resolved
    • P4
    • Resolution: Fixed
    • 15
    • 16
    • hotspot
    • None
    • b03


      When the world was still young, the Sweeper used to rely on safepoints to both mark on-stack nmethods, as well use it for heuristics (safepoint counters used to figure out when to sweep, and hotness counters used to sample on-stack nmethods).

      Now, spurious safepoints are getting removed left and right every day, and we are finding ourselves in a situation where safepoints are going to be very sparse. The remaining trace of this safepoint reliance, is the on-stack nmethod hotness counter sampling that is performed in safepoints.

      This per-thread sampling in a safepoint is not sparking joy for my JEP 376: ZGC: Concurrent Thread-Stack Processing, where the goal is to remove per-thread processing from GC safepoints. This sampling needs to be removed from the safepoint cleanup.

      Notably, the hotness counters are already poked during the sweeper nmethod marking operation. And since the nmethod marking operation is likely more when sweeping is of importance, and then probably more often than safepoints run, it would make sense to let the nmethod marking operation, also take full responsibility for the nmethod hotness counter sampling, without any reliance on safepoints and their cleanup.




            eosterlund Erik Ă–sterlund
            eosterlund Erik Ă–sterlund
            0 Vote for this issue
            2 Start watching this issue