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

Remove monitor deflation from final audit

XMLWordPrintable

    • b25

        In JDK-8318757 we can see that running a monitor deflation pass during a safepointed operation can interleave with the async monitor deflation, which causes various problems. The fix is to stop deflating monitors in the thread dump operation and instead only collect relevant monitors.

        There is yet another place where we call monitor deflation from outside of the monitor deflation thread. That place is the "final audit" part, which walks over monitors and performs verification and logging. Before the walk over the list of monitors we perform a monitor deflation pass to prune the system from "uninteresting" monitors.

        I propose that we remove the monitor deflation from the final audit, and that we instead only visit "interesting" monitors (those that have an owner or "is busy"). After this change it's only the monitor deflation thread that performs monitor deflation. It is unclear to me if the final audit can actually interleave with the async monitor deflation, but this removal makes it easier to reason around monitor deflation since it is only one thread that is performing it.

              stefank Stefan Karlsson
              stefank Stefan Karlsson
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: