2681 // for internal reasons. Try to set the mpss range using 2682 // the alignment_hint. 2683 page_size = alignment_hint; 2684 } 2685 // Since this is a hint, ignore any failures. 2686 (void)Solaris::set_mpss_range(addr, bytes, page_size); 2687 } 2688 return true; 2689 } 2690 return false; 2691 } 2692 2693 // Uncommit the pages in a specified region. 2694 void os::free_memory(char* addr, size_t bytes) { 2695 if (madvise(addr, bytes, MADV_FREE) < 0) { 2696 debug_only(warning("MADV_FREE failed.")); 2697 return; 2698 } 2699 } 2700 2701 // Change the page size in a given range. 2702 void os::realign_memory(char *addr, size_t bytes, size_t alignment_hint) { 2703 assert((intptr_t)addr % alignment_hint == 0, "Address should be aligned."); 2704 assert((intptr_t)(addr + bytes) % alignment_hint == 0, "End should be aligned."); 2705 Solaris::set_mpss_range(addr, bytes, alignment_hint); 2706 } 2707 2708 // Tell the OS to make the range local to the first-touching LWP 2709 void os::numa_make_local(char *addr, size_t bytes, int lgrp_hint) { 2710 assert((intptr_t)addr % os::vm_page_size() == 0, "Address should be page-aligned."); 2711 if (madvise(addr, bytes, MADV_ACCESS_LWP) < 0) { 2712 debug_only(warning("MADV_ACCESS_LWP failed.")); 2713 } 2714 } 2715 2716 // Tell the OS that this range would be accessed from different LWPs. 2717 void os::numa_make_global(char *addr, size_t bytes) { 2718 assert((intptr_t)addr % os::vm_page_size() == 0, "Address should be page-aligned."); 2719 if (madvise(addr, bytes, MADV_ACCESS_MANY) < 0) { 2720 debug_only(warning("MADV_ACCESS_MANY failed.")); | 2681 // for internal reasons. Try to set the mpss range using 2682 // the alignment_hint. 2683 page_size = alignment_hint; 2684 } 2685 // Since this is a hint, ignore any failures. 2686 (void)Solaris::set_mpss_range(addr, bytes, page_size); 2687 } 2688 return true; 2689 } 2690 return false; 2691 } 2692 2693 // Uncommit the pages in a specified region. 2694 void os::free_memory(char* addr, size_t bytes) { 2695 if (madvise(addr, bytes, MADV_FREE) < 0) { 2696 debug_only(warning("MADV_FREE failed.")); 2697 return; 2698 } 2699 } 2700 2701 bool os::create_stack_guard_pages(char* addr, size_t size) { 2702 return os::commit_memory(addr, size); 2703 } 2704 2705 bool os::remove_stack_guard_pages(char* addr, size_t size) { 2706 return os::uncommit_memory(addr, size); 2707 } 2708 2709 // Change the page size in a given range. 2710 void os::realign_memory(char *addr, size_t bytes, size_t alignment_hint) { 2711 assert((intptr_t)addr % alignment_hint == 0, "Address should be aligned."); 2712 assert((intptr_t)(addr + bytes) % alignment_hint == 0, "End should be aligned."); 2713 Solaris::set_mpss_range(addr, bytes, alignment_hint); 2714 } 2715 2716 // Tell the OS to make the range local to the first-touching LWP 2717 void os::numa_make_local(char *addr, size_t bytes, int lgrp_hint) { 2718 assert((intptr_t)addr % os::vm_page_size() == 0, "Address should be page-aligned."); 2719 if (madvise(addr, bytes, MADV_ACCESS_LWP) < 0) { 2720 debug_only(warning("MADV_ACCESS_LWP failed.")); 2721 } 2722 } 2723 2724 // Tell the OS that this range would be accessed from different LWPs. 2725 void os::numa_make_global(char *addr, size_t bytes) { 2726 assert((intptr_t)addr % os::vm_page_size() == 0, "Address should be page-aligned."); 2727 if (madvise(addr, bytes, MADV_ACCESS_MANY) < 0) { 2728 debug_only(warning("MADV_ACCESS_MANY failed.")); |