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

omit ThreadPriorityPolicy warning when value is set from image

    Details

    • Subcomponent:
    • Resolved In Build:
      b16

      Backports

        Description

        Now that flag values can be set in a jlink'ed image (JDK-8232080), certain places in the VM that check for FLAG_IS_DEFAULT might also want to consider values from jimage as default. One immediate example is the ThreadPriorityPolicy flag. The easiest way to support this is with a new FLAG_IS_JIMAGE_RESOURCE macro as seen here:

        https://github.com/graalvm/labs-openjdk-11/commit/4d54c72053a113d36d911e618542b73bfd8b0bab

        Background:

        On Hotspot for Linux/BSD, setting thread priorities is a nop, unless -XX:ThreadPriorityPolicy=1 is set and the JVM runs with root privileges. However, only raising thread priority requires system privileges (root or CAP_SYS_NICE) on Linux, while lowering priority can be done by an unprivileged user.

        In GraalVM, threads running less trusted Truffle guest application code need to be de-prioritized with respect to other (host application and system) threads, such as the JVM signal handler thread. As such, when GraalVM is built, --add-options is used to set ThreadPriorityPolicy to 1.

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  mneugschwand Matthias Neugschwandtner
                  Reporter:
                  dnsimon Douglas Simon
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  6 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: