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

Parallel pretouch should shortcut when only 1 thread is needed

    XMLWordPrintable

Details

    • gc

    Description

      Related to JDK-8312021, but a point fix for JDK-8252221.

      In `MutableSpace::initialize`, we call these two:

      ```
          if (AlwaysPreTouch) {
            PretouchTask::pretouch("ParallelGC PreTouch head", (char*)head.start(), (char*)head.end(),
                                   page_size, pretouch_workers);

            PretouchTask::pretouch("ParallelGC PreTouch tail", (char*)tail.start(), (char*)tail.end(),
                                   page_size, pretouch_workers);
          }
      ```

      ...which start the pre-touch threads unconditionally, even when we only need one thread anyway. This incurs latency of about 100us (2x 50us) in my setups. We can run the pre-touch the in the caller thread, like it was done before JDK-8252221 to eliminate that overhead.

      Attachments

        Issue Links

          Activity

            People

              shade Aleksey Shipilev
              shade Aleksey Shipilev
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: