Mercurial > hg > truffle
comparison src/os/windows/vm/os_windows.cpp @ 3318:188c9a5d6a6d
7040485: Use transparent huge page on linux by default
Summary: Turn on UseLargePages by default but try only HugeTLBFS method if it is not explicitly specified on the command line.
Reviewed-by: ysr
author | iveresov |
---|---|
date | Fri, 29 Apr 2011 12:39:32 -0700 |
parents | 5504afd15955 |
children | 7c948af3e651 bf6481e5f96d |
comparison
equal
deleted
inserted
replaced
3315:da0fffdcc453 | 3318:188c9a5d6a6d |
---|---|
2760 _hProcess = NULL; | 2760 _hProcess = NULL; |
2761 if (_hToken) CloseHandle(_hToken); | 2761 if (_hToken) CloseHandle(_hToken); |
2762 _hToken = NULL; | 2762 _hToken = NULL; |
2763 } | 2763 } |
2764 | 2764 |
2765 bool os::large_page_init() { | 2765 void os::large_page_init() { |
2766 if (!UseLargePages) return false; | 2766 if (!UseLargePages) return; |
2767 | 2767 |
2768 // print a warning if any large page related flag is specified on command line | 2768 // print a warning if any large page related flag is specified on command line |
2769 bool warn_on_failure = !FLAG_IS_DEFAULT(UseLargePages) || | 2769 bool warn_on_failure = !FLAG_IS_DEFAULT(UseLargePages) || |
2770 !FLAG_IS_DEFAULT(LargePageSizeInBytes); | 2770 !FLAG_IS_DEFAULT(LargePageSizeInBytes); |
2771 bool success = false; | 2771 bool success = false; |
2806 _page_sizes[1] = default_page_size; | 2806 _page_sizes[1] = default_page_size; |
2807 _page_sizes[2] = 0; | 2807 _page_sizes[2] = 0; |
2808 } | 2808 } |
2809 | 2809 |
2810 cleanup_after_large_page_init(); | 2810 cleanup_after_large_page_init(); |
2811 return success; | 2811 UseLargePages = success; |
2812 } | 2812 } |
2813 | 2813 |
2814 // On win32, one cannot release just a part of reserved memory, it's an | 2814 // On win32, one cannot release just a part of reserved memory, it's an |
2815 // all or nothing deal. When we split a reservation, we must break the | 2815 // all or nothing deal. When we split a reservation, we must break the |
2816 // reservation into two reservations. | 2816 // reservation into two reservations. |
3559 if(Verbose && PrintMiscellaneous) | 3559 if(Verbose && PrintMiscellaneous) |
3560 tty->print("[Memory Serialize Page address: " INTPTR_FORMAT "]\n", (intptr_t)mem_serialize_page); | 3560 tty->print("[Memory Serialize Page address: " INTPTR_FORMAT "]\n", (intptr_t)mem_serialize_page); |
3561 #endif | 3561 #endif |
3562 } | 3562 } |
3563 | 3563 |
3564 FLAG_SET_DEFAULT(UseLargePages, os::large_page_init()); | 3564 os::large_page_init(); |
3565 | 3565 |
3566 // Setup Windows Exceptions | 3566 // Setup Windows Exceptions |
3567 | 3567 |
3568 // On Itanium systems, Structured Exception Handling does not | 3568 // On Itanium systems, Structured Exception Handling does not |
3569 // work since stack frames must be walkable by the OS. Since | 3569 // work since stack frames must be walkable by the OS. Since |