src/os/linux/vm/os_linux.cpp

Print this page




4286 #endif
4287   }
4288 
4289   os::large_page_init();
4290 
4291   // initialize suspend/resume support - must do this before signal_sets_init()
4292   if (SR_initialize() != 0) {
4293     perror("SR_initialize failed");
4294     return JNI_ERR;
4295   }
4296 
4297   Linux::signal_sets_init();
4298   Linux::install_signal_handlers();
4299 
4300   // Check minimum allowable stack size for thread creation and to initialize
4301   // the java system classes, including StackOverflowError - depends on page
4302   // size.  Add a page for compiler2 recursion in main thread.
4303   // Add in 2*BytesPerWord times page size to account for VM stack during
4304   // class initialization depending on 32 or 64 bit VM.
4305   os::Linux::min_stack_allowed = MAX2(os::Linux::min_stack_allowed,
4306             (size_t)(StackYellowPages+StackRedPages+StackShadowPages+
4307                     2*BytesPerWord COMPILER2_PRESENT(+1)) * Linux::page_size());
4308 
4309   size_t threadStackSizeInBytes = ThreadStackSize * K;
4310   if (threadStackSizeInBytes != 0 &&
4311       threadStackSizeInBytes < os::Linux::min_stack_allowed) {
4312         tty->print_cr("\nThe stack size specified is too small, "
4313                       "Specify at least %dk",
4314                       os::Linux::min_stack_allowed/ K);
4315         return JNI_ERR;
4316   }
4317 
4318   // Make the stack size a multiple of the page size so that
4319   // the yellow/red zones can be guarded.
4320   JavaThread::set_stack_size_at_create(round_to(threadStackSizeInBytes,
4321         vm_page_size()));
4322 
4323   Linux::capture_initial_stack(JavaThread::stack_size_at_create());
4324 
4325   Linux::libpthread_init();
4326   if (PrintMiscellaneous && (Verbose || WizardMode)) {
4327      tty->print_cr("[HotSpot is running with %s, %s(%s)]\n",




4286 #endif
4287   }
4288 
4289   os::large_page_init();
4290 
4291   // initialize suspend/resume support - must do this before signal_sets_init()
4292   if (SR_initialize() != 0) {
4293     perror("SR_initialize failed");
4294     return JNI_ERR;
4295   }
4296 
4297   Linux::signal_sets_init();
4298   Linux::install_signal_handlers();
4299 
4300   // Check minimum allowable stack size for thread creation and to initialize
4301   // the java system classes, including StackOverflowError - depends on page
4302   // size.  Add a page for compiler2 recursion in main thread.
4303   // Add in 2*BytesPerWord times page size to account for VM stack during
4304   // class initialization depending on 32 or 64 bit VM.
4305   os::Linux::min_stack_allowed = MAX2(os::Linux::min_stack_allowed,
4306             (size_t)(StackYellowPages+StackRedPages+StackShadowPages) * Linux::page_size() +
4307                     (2*BytesPerWord COMPILER2_PRESENT(+1)) * Linux::vm_default_page_size());
4308 
4309   size_t threadStackSizeInBytes = ThreadStackSize * K;
4310   if (threadStackSizeInBytes != 0 &&
4311       threadStackSizeInBytes < os::Linux::min_stack_allowed) {
4312         tty->print_cr("\nThe stack size specified is too small, "
4313                       "Specify at least %dk",
4314                       os::Linux::min_stack_allowed/ K);
4315         return JNI_ERR;
4316   }
4317 
4318   // Make the stack size a multiple of the page size so that
4319   // the yellow/red zones can be guarded.
4320   JavaThread::set_stack_size_at_create(round_to(threadStackSizeInBytes,
4321         vm_page_size()));
4322 
4323   Linux::capture_initial_stack(JavaThread::stack_size_at_create());
4324 
4325   Linux::libpthread_init();
4326   if (PrintMiscellaneous && (Verbose || WizardMode)) {
4327      tty->print_cr("[HotSpot is running with %s, %s(%s)]\n",