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

THP not working properly with G1 after JDK-8345655

XMLWordPrintable

    • gc
    • b14

      In JDK-8345655 we refactored the memory reservation code to be more maintainable and easier to follow. When doing this one of the code paths changed to always pass in `os::vm_page_size()` where it previously had used a page size provided by the caller.

      Even if the alignment for `ReservedSpace`s created this way show that they should be aligned to support large pages the page size member for the `ReservedSpace` does not convey that we want large pages for the space. In G1 when using `G1PageBaseVirtualSpace` we use the above mentioned page size as the alignment for the reservation. This leads to the reservations (made using the API) not being THP eligible.

      This is only an issue when the system is configured with the THP mode of `madvise`. If the mode is `always`, we will get THP eligible reservations. So a fairly simple workaround for this issue (given you have access to configuring your system) is to configure the THP mode to always.

            sjohanss Stefan Johansson
            sjohanss Stefan Johansson
            Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved: