src/os/linux/vm/os_linux.cpp

Print this page




4285   guarantee( polling_page != MAP_FAILED, "os::init_2: failed to allocate polling page" );
4286 
4287   os::set_polling_page( polling_page );
4288 
4289 #ifndef PRODUCT
4290   if(Verbose && PrintMiscellaneous)
4291     tty->print("[SafePoint Polling address: " INTPTR_FORMAT "]\n", (intptr_t)polling_page);
4292 #endif
4293 
4294   if (!UseMembar) {
4295     address mem_serialize_page = (address) ::mmap(NULL, Linux::page_size(), PROT_READ | PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
4296     guarantee( mem_serialize_page != NULL, "mmap Failed for memory serialize page");
4297     os::set_memory_serialize_page( mem_serialize_page );
4298 
4299 #ifndef PRODUCT
4300     if(Verbose && PrintMiscellaneous)
4301       tty->print("[Memory Serialize  Page address: " INTPTR_FORMAT "]\n", (intptr_t)mem_serialize_page);
4302 #endif
4303   }
4304 
4305   os::large_page_init();
4306 
4307   // initialize suspend/resume support - must do this before signal_sets_init()
4308   if (SR_initialize() != 0) {
4309     perror("SR_initialize failed");
4310     return JNI_ERR;
4311   }
4312 
4313   Linux::signal_sets_init();
4314   Linux::install_signal_handlers();
4315 
4316   // Check minimum allowable stack size for thread creation and to initialize
4317   // the java system classes, including StackOverflowError - depends on page
4318   // size.  Add a page for compiler2 recursion in main thread.
4319   // Add in 2*BytesPerWord times page size to account for VM stack during
4320   // class initialization depending on 32 or 64 bit VM.
4321   os::Linux::min_stack_allowed = MAX2(os::Linux::min_stack_allowed,
4322             (size_t)(StackYellowPages+StackRedPages+StackShadowPages) * Linux::page_size() +
4323                     (2*BytesPerWord COMPILER2_PRESENT(+1)) * Linux::vm_default_page_size());
4324 
4325   size_t threadStackSizeInBytes = ThreadStackSize * K;
4326   if (threadStackSizeInBytes != 0 &&




4285   guarantee( polling_page != MAP_FAILED, "os::init_2: failed to allocate polling page" );
4286 
4287   os::set_polling_page( polling_page );
4288 
4289 #ifndef PRODUCT
4290   if(Verbose && PrintMiscellaneous)
4291     tty->print("[SafePoint Polling address: " INTPTR_FORMAT "]\n", (intptr_t)polling_page);
4292 #endif
4293 
4294   if (!UseMembar) {
4295     address mem_serialize_page = (address) ::mmap(NULL, Linux::page_size(), PROT_READ | PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
4296     guarantee( mem_serialize_page != NULL, "mmap Failed for memory serialize page");
4297     os::set_memory_serialize_page( mem_serialize_page );
4298 
4299 #ifndef PRODUCT
4300     if(Verbose && PrintMiscellaneous)
4301       tty->print("[Memory Serialize  Page address: " INTPTR_FORMAT "]\n", (intptr_t)mem_serialize_page);
4302 #endif
4303   }
4304 


4305   // initialize suspend/resume support - must do this before signal_sets_init()
4306   if (SR_initialize() != 0) {
4307     perror("SR_initialize failed");
4308     return JNI_ERR;
4309   }
4310 
4311   Linux::signal_sets_init();
4312   Linux::install_signal_handlers();
4313 
4314   // Check minimum allowable stack size for thread creation and to initialize
4315   // the java system classes, including StackOverflowError - depends on page
4316   // size.  Add a page for compiler2 recursion in main thread.
4317   // Add in 2*BytesPerWord times page size to account for VM stack during
4318   // class initialization depending on 32 or 64 bit VM.
4319   os::Linux::min_stack_allowed = MAX2(os::Linux::min_stack_allowed,
4320             (size_t)(StackYellowPages+StackRedPages+StackShadowPages) * Linux::page_size() +
4321                     (2*BytesPerWord COMPILER2_PRESENT(+1)) * Linux::vm_default_page_size());
4322 
4323   size_t threadStackSizeInBytes = ThreadStackSize * K;
4324   if (threadStackSizeInBytes != 0 &&