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

Improve detection of failure to reach a safepoint

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P4 P4
    • tbd
    • 11
    • hotspot
    • 11

      In doing the cleanup associated with JDK-8194085 we left in place a check that detects failure to reach a safepoint.

      Old code:

      if (SafepointMechanism::uses_global_page_poll() && int(iterations) == DeferPollingPageLoopCount) {
        guarantee (PageArmed == 0, "invariant") ;
        PageArmed = 1 ;
        os::make_polling_page_unreadable();
      }

      New code:

      if (int(iterations) == -1) { // overflow - something is wrong.
        // We can only overflow here when we are using global
        // polling pages. We keep this guarantee in its original
        // form so that searches of the bug database for this
        // failure mode find the right bugs.
        guarantee (PageArmed == 0, "invariant");
      }

      To maintain the existing behaviour the above should have kept the full condition:

      if (SafepointMechanism::uses_global_page_poll() && int(iterations) == -1)

      But Dan then raised the question as to what happens when we are not using the global polling page:

      1) is it possible to overflow iterations when not using global polling pages?
      2) should we fail a guarantee if that happens?

      We do need to check how handshake based safepoint polling responds in cases where we would fail the guarantee and if we can get stuck and need to detect the problem as we do for the global poll page.

            pchilanomate Patricio Chilano Mateo
            dholmes David Holmes
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: