Mercurial > hg > graal-compiler
comparison src/os/solaris/vm/os_solaris.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 | c303b3532d4a |
children | bf6481e5f96d |
comparison
equal
deleted
inserted
replaced
3315:da0fffdcc453 | 3318:188c9a5d6a6d |
---|---|
3334 *page_size = _page_sizes[0]; | 3334 *page_size = _page_sizes[0]; |
3335 | 3335 |
3336 return true; | 3336 return true; |
3337 } | 3337 } |
3338 | 3338 |
3339 bool os::large_page_init() { | 3339 void os::large_page_init() { |
3340 if (!UseLargePages) { | 3340 if (!UseLargePages) { |
3341 UseISM = false; | 3341 UseISM = false; |
3342 UseMPSS = false; | 3342 UseMPSS = false; |
3343 return false; | 3343 return; |
3344 } | 3344 } |
3345 | 3345 |
3346 // print a warning if any large page related flag is specified on command line | 3346 // print a warning if any large page related flag is specified on command line |
3347 bool warn_on_failure = !FLAG_IS_DEFAULT(UseLargePages) || | 3347 bool warn_on_failure = !FLAG_IS_DEFAULT(UseLargePages) || |
3348 !FLAG_IS_DEFAULT(UseISM) || | 3348 !FLAG_IS_DEFAULT(UseISM) || |
3359 | 3359 |
3360 UseMPSS = UseMPSS && | 3360 UseMPSS = UseMPSS && |
3361 Solaris::mpss_sanity_check(warn_on_failure, &_large_page_size); | 3361 Solaris::mpss_sanity_check(warn_on_failure, &_large_page_size); |
3362 | 3362 |
3363 UseLargePages = UseISM || UseMPSS; | 3363 UseLargePages = UseISM || UseMPSS; |
3364 return UseLargePages; | |
3365 } | 3364 } |
3366 | 3365 |
3367 bool os::Solaris::set_mpss_range(caddr_t start, size_t bytes, size_t align) { | 3366 bool os::Solaris::set_mpss_range(caddr_t start, size_t bytes, size_t align) { |
3368 // Signal to OS that we want large pages for addresses | 3367 // Signal to OS that we want large pages for addresses |
3369 // from addr, addr + bytes | 3368 // from addr, addr + bytes |
4990 if(Verbose && PrintMiscellaneous) | 4989 if(Verbose && PrintMiscellaneous) |
4991 tty->print("[Memory Serialize Page address: " INTPTR_FORMAT "]\n", (intptr_t)mem_serialize_page); | 4990 tty->print("[Memory Serialize Page address: " INTPTR_FORMAT "]\n", (intptr_t)mem_serialize_page); |
4992 #endif | 4991 #endif |
4993 } | 4992 } |
4994 | 4993 |
4995 FLAG_SET_DEFAULT(UseLargePages, os::large_page_init()); | 4994 os::large_page_init(); |
4996 | 4995 |
4997 // Check minimum allowable stack size for thread creation and to initialize | 4996 // Check minimum allowable stack size for thread creation and to initialize |
4998 // the java system classes, including StackOverflowError - depends on page | 4997 // the java system classes, including StackOverflowError - depends on page |
4999 // size. Add a page for compiler2 recursion in main thread. | 4998 // size. Add a page for compiler2 recursion in main thread. |
5000 // Add in 2*BytesPerWord times page size to account for VM stack during | 4999 // Add in 2*BytesPerWord times page size to account for VM stack during |