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

Update FilterSpuriousWakeups documentation. Review "Solaris only" vm options descriptions

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 7u60, emb-8u6, emb-8u26, 8, 8u20, 9
    • Fix Version/s: 9
    • Component/s: hotspot
    • Subcomponent:
    • Resolved In Build:
      b20

      Description

      Some VM options have "Solaris only" text in their descriptions. For current moment this information is outdated. For instance, FilterSpuriousWakeups actually is checked for all nix systems, but comment says "Solaris only"(shown only in nonproduct):

      $ grep -rin -C 5 FilterSpuriousWakeups src/
      src/os/aix/vm/os_aix.cpp-4744-
      src/os/aix/vm/os_aix.cpp-4745- while (_Event < 0) {
      src/os/aix/vm/os_aix.cpp-4746- status = pthread_cond_timedwait(_cond, _mutex, &abst);
      src/os/aix/vm/os_aix.cpp-4747- assert_status(status == 0 || status == ETIMEDOUT,
      src/os/aix/vm/os_aix.cpp-4748- status, "cond_timedwait");
      src/os/aix/vm/os_aix.cpp:4749: if (!FilterSpuriousWakeups) break; // previous semantics
      src/os/aix/vm/os_aix.cpp-4750- if (status == ETIMEDOUT) break;
      src/os/aix/vm/os_aix.cpp-4751- // We consume and ignore EINTR and spurious wakeups.
      src/os/aix/vm/os_aix.cpp-4752- }
      src/os/aix/vm/os_aix.cpp-4753- --_nParked;
      src/os/aix/vm/os_aix.cpp-4754- if (_Event >= 0) {
      --
      src/os/bsd/vm/os_bsd.cpp-4314- pthread_cond_init (_cond, NULL) ;
      src/os/bsd/vm/os_bsd.cpp-4315- }
      src/os/bsd/vm/os_bsd.cpp-4316- assert_status(status == 0 || status == EINTR ||
      src/os/bsd/vm/os_bsd.cpp-4317- status == ETIMEDOUT,
      src/os/bsd/vm/os_bsd.cpp-4318- status, "cond_timedwait");
      src/os/bsd/vm/os_bsd.cpp:4319: if (!FilterSpuriousWakeups) break ; // previous semantics
      src/os/bsd/vm/os_bsd.cpp-4320- if (status == ETIMEDOUT) break ;
      src/os/bsd/vm/os_bsd.cpp-4321- // We consume and ignore EINTR and spurious wakeups.
      src/os/bsd/vm/os_bsd.cpp-4322- }
      src/os/bsd/vm/os_bsd.cpp-4323- --_nParked ;
      src/os/bsd/vm/os_bsd.cpp-4324- if (_Event >= 0) {
      --
      src/os/linux/vm/os_linux.cpp-5553- pthread_cond_init (_cond, os::Linux::condAttr()) ;
      src/os/linux/vm/os_linux.cpp-5554- }
      src/os/linux/vm/os_linux.cpp-5555- assert_status(status == 0 || status == EINTR ||
      src/os/linux/vm/os_linux.cpp-5556- status == ETIME || status == ETIMEDOUT,
      src/os/linux/vm/os_linux.cpp-5557- status, "cond_timedwait");
      src/os/linux/vm/os_linux.cpp:5558: if (!FilterSpuriousWakeups) break ; // previous semantics
      src/os/linux/vm/os_linux.cpp-5559- if (status == ETIME || status == ETIMEDOUT) break ;
      src/os/linux/vm/os_linux.cpp-5560- // We consume and ignore EINTR and spurious wakeups.
      src/os/linux/vm/os_linux.cpp-5561- }
      src/os/linux/vm/os_linux.cpp-5562- --_nParked ;
      src/os/linux/vm/os_linux.cpp-5563- if (_Event >= 0) {
      --
      src/os/solaris/vm/os_solaris.cpp-5520- while (_Event < 0) {
      src/os/solaris/vm/os_solaris.cpp-5521- int status = os::Solaris::cond_timedwait(_cond, _mutex, &abst);
      src/os/solaris/vm/os_solaris.cpp-5522- assert_status(status == 0 || status == EINTR ||
      src/os/solaris/vm/os_solaris.cpp-5523- status == ETIME || status == ETIMEDOUT,
      src/os/solaris/vm/os_solaris.cpp-5524- status, "cond_timedwait");
      src/os/solaris/vm/os_solaris.cpp:5525: if (!FilterSpuriousWakeups) break ; // previous semantics
      src/os/solaris/vm/os_solaris.cpp-5526- if (status == ETIME || status == ETIMEDOUT) break ;
      src/os/solaris/vm/os_solaris.cpp-5527- // We consume and ignore EINTR and spurious wakeups.
      src/os/solaris/vm/os_solaris.cpp-5528- }
      src/os/solaris/vm/os_solaris.cpp-5529- -- _nParked ;
      src/os/solaris/vm/os_solaris.cpp-5530- if (_Event >= 0) ret = OS_OK ;
      --
      src/share/vm/runtime/globals.hpp-1140- \
      src/share/vm/runtime/globals.hpp-1141- product(intx, WorkAroundNPTLTimedWaitHang, 1, \
      src/share/vm/runtime/globals.hpp-1142- "(Unstable, Linux-specific) " \
      src/share/vm/runtime/globals.hpp-1143- "avoid NPTL-FUTEX hang pthread_cond_timedwait") \
      src/share/vm/runtime/globals.hpp-1144- \
      src/share/vm/runtime/globals.hpp:1145: product(bool, FilterSpuriousWakeups, true, \
      src/share/vm/runtime/globals.hpp-1146- "Prevent spurious or premature wakeups from object.wait " \
      src/share/vm/runtime/globals.hpp-1147- "(Solaris only)") \
      src/share/vm/runtime/globals.hpp-1148- \
      src/share/vm/runtime/globals.hpp-1149- product(intx, NativeMonitorTimeout, -1, "(Unstable)") \
      src/share/vm/runtime/globals.hpp-1150-

      same we can see for DontYieldALot and ConvertYieldToSleep options.


      Additionally, FilterSpuriousWakeups has inaccurate comments in OS-specific files(os/aix/vm/os_aix.cpp, os/bsd/vm/os_bsd.cpp, os/linux/vm/os_linux.cpp), which erroneously claiming, that FilterSpuriousWakeups option prevents these wakeups be visible in Java code. But actually it's just filtering OS wakeups only. (UPDATE form David's comment: https://bugs.openjdk.java.net/browse/JDK-8044339?focusedCommentId=13502812&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13502812)

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              lpriima Lev Priima
              Reporter:
              lpriima Lev Priima
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: