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

Refactor reserve_memory_special_huge_tlbfs

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P4
    • 17
    • 17
    • hotspot
    • None
    • gc
    • b18

    Description

      The condition for when a special mapping should use only large pages or a mix of large and normal is confusing.

      The current statement is:
      ```
        if (is_aligned(bytes, os::large_page_size()) && alignment <= os::large_page_size()) {
          return reserve_memory_special_huge_tlbfs_only(bytes, req_addr, exec);
        } else {
          return reserve_memory_special_huge_tlbfs_mixed(bytes, alignment, req_addr, exec);
        }
      ```
      The confusing part here is the alignment check, because if the size is aligned with the page size we know the mapping don't have to use a mix of large and small pages. The reason the alignment check is there is because there are cases where the alignment is large than the page size and currently only the reserve_memory_special_huge_tlbfs_mixed()-call honour the alignment request.

      To solve this we should refactor the function to handle all uses-cases without the only/mixed helpers.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: