src/os/solaris/vm/os_solaris.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File UseNUMA Sdiff src/os/solaris/vm

src/os/solaris/vm/os_solaris.cpp

Print this page
rev 3420 : Fix for Solaris
rev 3421 : Add UseNUMAInterleaving


5115   // stack for 64kb (or any > than 8kb) pages, this increases
5116   // virtual memory fragmentation (since we're not creating the
5117   // stack on a power of 2 boundary.  The real fix for this
5118   // should be to fix the guard page mechanism.
5119 
5120   if (vm_page_size() > 8*K) {
5121       threadStackSizeInBytes = (threadStackSizeInBytes != 0)
5122          ? threadStackSizeInBytes +
5123            ((StackYellowPages + StackRedPages) * vm_page_size())
5124          : 0;
5125       ThreadStackSize = threadStackSizeInBytes/K;
5126   }
5127 
5128   // Make the stack size a multiple of the page size so that
5129   // the yellow/red zones can be guarded.
5130   JavaThread::set_stack_size_at_create(round_to(threadStackSizeInBytes,
5131         vm_page_size()));
5132 
5133   Solaris::libthread_init();
5134 




5135   if (UseNUMA) {

5136     if (!Solaris::liblgrp_init()) {
5137       UseNUMA = false;
5138     } else {
5139       size_t lgrp_limit = os::numa_get_groups_num();
5140       int *lgrp_ids = NEW_C_HEAP_ARRAY(int, lgrp_limit);
5141       size_t lgrp_num = os::numa_get_leaf_groups(lgrp_ids, lgrp_limit);
5142       FREE_C_HEAP_ARRAY(int, lgrp_ids);
5143       if (lgrp_num < 2) {
5144         // There's only one locality group, disable NUMA.
5145         UseNUMA = false;
5146       }









5147     }
5148     // ISM is not compatible with the NUMA allocator - it always allocates
5149     // pages round-robin across the lgroups.
5150     if (UseNUMA && UseLargePages && UseISM) {
5151       if (!FLAG_IS_DEFAULT(UseNUMA)) {
5152         if (FLAG_IS_DEFAULT(UseLargePages) && FLAG_IS_DEFAULT(UseISM)) {
5153           UseLargePages = false;
5154         } else {
5155           warning("UseNUMA is not compatible with ISM large pages, disabling NUMA allocator");
5156           UseNUMA = false;
5157         }
5158       } else {
5159         UseNUMA = false;
5160       }
5161     }
5162     if (!UseNUMA && ForceNUMA) {
5163       UseNUMA = true;
5164     }
5165   }
5166 




5115   // stack for 64kb (or any > than 8kb) pages, this increases
5116   // virtual memory fragmentation (since we're not creating the
5117   // stack on a power of 2 boundary.  The real fix for this
5118   // should be to fix the guard page mechanism.
5119 
5120   if (vm_page_size() > 8*K) {
5121       threadStackSizeInBytes = (threadStackSizeInBytes != 0)
5122          ? threadStackSizeInBytes +
5123            ((StackYellowPages + StackRedPages) * vm_page_size())
5124          : 0;
5125       ThreadStackSize = threadStackSizeInBytes/K;
5126   }
5127 
5128   // Make the stack size a multiple of the page size so that
5129   // the yellow/red zones can be guarded.
5130   JavaThread::set_stack_size_at_create(round_to(threadStackSizeInBytes,
5131         vm_page_size()));
5132 
5133   Solaris::libthread_init();
5134 
5135 #ifdef _LP64
5136   // For 64 bit numa systems, enable numa features if heap is large enough
5137   if (UseNUMA || (FLAG_IS_DEFAULT(UseNUMA) && is_server_class_machine())) {
5138 #else
5139   if (UseNUMA) {
5140 #endif
5141     if (!Solaris::liblgrp_init()) {
5142       UseNUMA = false;
5143     } else {
5144       size_t lgrp_limit = os::numa_get_groups_num();
5145       int *lgrp_ids = NEW_C_HEAP_ARRAY(int, lgrp_limit);
5146       size_t lgrp_num = os::numa_get_leaf_groups(lgrp_ids, lgrp_limit);
5147       FREE_C_HEAP_ARRAY(int, lgrp_ids);
5148       if (lgrp_num < 2) {
5149         // There's only one locality group, disable NUMA.
5150         UseNUMA = false;
5151       }
5152 #ifdef _LP64
5153       else {
5154         // There is more than 1 node
5155         if (FLAG_IS_DEFAULT(UseNUMA) && (MaxHeapSize >= NUMAAutoStartHeapSize)) {
5156           UseNUMA = true;
5157           UseNUMAInterleaving = true;
5158         }
5159       }
5160 #endif
5161     }
5162     // ISM is not compatible with the NUMA allocator - it always allocates
5163     // pages round-robin across the lgroups.
5164     if (UseNUMA && UseLargePages && UseISM) {
5165       if (!FLAG_IS_DEFAULT(UseNUMA)) {
5166         if (FLAG_IS_DEFAULT(UseLargePages) && FLAG_IS_DEFAULT(UseISM)) {
5167           UseLargePages = false;
5168         } else {
5169           warning("UseNUMA is not compatible with ISM large pages, disabling NUMA allocator");
5170           UseNUMA = false;
5171         }
5172       } else {
5173         UseNUMA = false;
5174       }
5175     }
5176     if (!UseNUMA && ForceNUMA) {
5177       UseNUMA = true;
5178     }
5179   }
5180 


src/os/solaris/vm/os_solaris.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File