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

nmethodLocker not needed for COMPILED_METHOD_UNLOAD events

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 14
    • Fix Version/s: 14
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b26

      Description

      The compiled method unload events save the code_start and jmethodID, and due to previous changes to keep nmethod from being unloaded and zombied, the nmethod compiled method load and unload events will be properly ordered.

      So the nmethodLocker is unneeded.

      Erik Österlund 12:47 PM: Why the nmethodLocker is problematic:

      It is an effort of reducing the different flavours of dead nmethods, in order to make it easier to reason about the code. We have unloaded, zombie, and things that are none of the two that are is_unloading(), and then we have zombies that are is_unloading(), and then on top of that nmethod locker adds yet another dimension to the flavours of dead, where all of said states exist with zero and non-zero reference counters. We have had obscure bugs that occur only with JVMTI deferred events because it twists the life cycle slightly in ways that nobody thought about, because it is actually impossible to think about all these different flavours of dead. For example, we almost always prevent nmethod locked nmethods from transitioning from is_alive() to !is_alive(), except if the reason it died is that it became unloaded.

      By keeping things alive through tracing (the iterators), then we have fewer flavours of dead nmethods (they become neither zombie nor unloaded), and its easier to know what happens.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                coleenp Coleen Phillimore
                Reporter:
                coleenp Coleen Phillimore
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: