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

Solaris for >8k pagesize adds extra guard pages

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P3
    • Resolution: Duplicate
    • Affects Version/s: 9
    • Fix Version/s: 10
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
    • OS:
      solaris

      Description


      min_stack_size allowed already accounts for guard zone and shadow zone:

      os::Solaris::java_thread_min_stack_allowed = MAX2(os::Solaris::java_thread_min_stack_allowed,
                                                          JavaThread::stack_guard_zone_size() +
                                                          JavaThread::stack_shadow_zone_size() +
                                                          (4 * BytesPerWord COMPILER2_PRESENT(+ 2)) * 4 * K);


      This extra adjustment to thread stack size is unnecessary and adds more stack space to running threads. This was legacy code when the stack overflow handling code didn't know how to cope with large pages, which was fixed in linked bug.

        // For 64kbps there will be a 64kb page size, which makes
        // the usable default stack size quite a bit less. Increase the
        // stack for 64kb (or any > than 8kb) pages, this increases
        // virtual memory fragmentation (since we're not creating the
        // stack on a power of 2 boundary. The real fix for this
        // should be to fix the guard page mechanism.

        if (vm_page_size() > 8*K) {
          threadStackSizeInBytes = (threadStackSizeInBytes != 0)
             ? threadStackSizeInBytes +
               JavaThread::stack_red_zone_size() +
               JavaThread::stack_yellow_zone_size()
             : 0;
          ThreadStackSize = threadStackSizeInBytes/K;
        }

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                coleenp Coleen Phillimore
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: