2824 |
2824 |
2825 // Change the page size in a given range. |
2825 // Change the page size in a given range. |
2826 void os::realign_memory(char *addr, size_t bytes, size_t alignment_hint) { |
2826 void os::realign_memory(char *addr, size_t bytes, size_t alignment_hint) { |
2827 assert((intptr_t)addr % alignment_hint == 0, "Address should be aligned."); |
2827 assert((intptr_t)addr % alignment_hint == 0, "Address should be aligned."); |
2828 assert((intptr_t)(addr + bytes) % alignment_hint == 0, "End should be aligned."); |
2828 assert((intptr_t)(addr + bytes) % alignment_hint == 0, "End should be aligned."); |
2829 Solaris::set_mpss_range(addr, bytes, alignment_hint); |
2829 if (UseLargePages && UseMPSS) { |
|
2830 Solaris::set_mpss_range(addr, bytes, alignment_hint); |
|
2831 } |
2830 } |
2832 } |
2831 |
2833 |
2832 // Tell the OS to make the range local to the first-touching LWP |
2834 // Tell the OS to make the range local to the first-touching LWP |
2833 void os::numa_make_local(char *addr, size_t bytes, int lgrp_hint) { |
2835 void os::numa_make_local(char *addr, size_t bytes, int lgrp_hint) { |
2834 assert((intptr_t)addr % os::vm_page_size() == 0, "Address should be page-aligned."); |
2836 assert((intptr_t)addr % os::vm_page_size() == 0, "Address should be page-aligned."); |
5039 int *lgrp_ids = NEW_C_HEAP_ARRAY(int, lgrp_limit); |
5041 int *lgrp_ids = NEW_C_HEAP_ARRAY(int, lgrp_limit); |
5040 size_t lgrp_num = os::numa_get_leaf_groups(lgrp_ids, lgrp_limit); |
5042 size_t lgrp_num = os::numa_get_leaf_groups(lgrp_ids, lgrp_limit); |
5041 FREE_C_HEAP_ARRAY(int, lgrp_ids); |
5043 FREE_C_HEAP_ARRAY(int, lgrp_ids); |
5042 if (lgrp_num < 2) { |
5044 if (lgrp_num < 2) { |
5043 // There's only one locality group, disable NUMA. |
5045 // There's only one locality group, disable NUMA. |
|
5046 UseNUMA = false; |
|
5047 } |
|
5048 } |
|
5049 // ISM is not compatible with the NUMA allocator - it always allocates |
|
5050 // pages round-robin across the lgroups. |
|
5051 if (UseNUMA && UseLargePages && UseISM) { |
|
5052 if (!FLAG_IS_DEFAULT(UseNUMA)) { |
|
5053 if (FLAG_IS_DEFAULT(UseLargePages) && FLAG_IS_DEFAULT(UseISM)) { |
|
5054 UseLargePages = false; |
|
5055 } else { |
|
5056 warning("UseNUMA is not compatible with ISM large pages, disabling NUMA allocator"); |
|
5057 UseNUMA = false; |
|
5058 } |
|
5059 } else { |
5044 UseNUMA = false; |
5060 UseNUMA = false; |
5045 } |
5061 } |
5046 } |
5062 } |
5047 if (!UseNUMA && ForceNUMA) { |
5063 if (!UseNUMA && ForceNUMA) { |
5048 UseNUMA = true; |
5064 UseNUMA = true; |