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

Permit use of memory concurrent with pretouch

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 18
    • Fix Version/s: 19
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b10

      Description

      os::pretouch_memory is called under various circumstances, to ensure the OS has actually mapped physical memory to the associated committed virtual memory range. It is implemented using a store to each page in the range. A load won't do, because some OS's initially map a write-protected shared zero page.

      Because pretouching involves writes, it must be done before any use of the memory. That can stall useful work that could be using some pages while the complete range gets touched.

      An alternative to a simple store is an atomic add of zero to a location in the page. Performance testing suggests there isn't any noticeable difference between using ordinary stores and (relaxed) atomic add of zero to touch pages on either x64 or aarch64. The page allocation swamps the cost of the atomic operation.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              kbarrett Kim Barrett
              Reporter:
              kbarrett Kim Barrett
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: