< prev index next >

src/os_cpu/linux_s390/vm/os_linux_s390.cpp

Print this page
rev 12307 : 8169373: Work around linux NPTL stack guard error.
Summary: Also streamline OS guard page handling on linuxs390, linuxppc, aixppc.
rev 12308 : imported patch new_os_guard_for_java_thread.patch


 456   ShouldNotReachHere();
 457   return false;
 458 }
 459 
 460 void os::Linux::init_thread_fpu_state(void) {
 461   // Nothing to do on z/Architecture.
 462 }
 463 
 464 int os::Linux::get_fpu_control_word(void) {
 465   // Nothing to do on z/Architecture.
 466   return 0;
 467 }
 468 
 469 void os::Linux::set_fpu_control_word(int fpu_control) {
 470   // Nothing to do on z/Architecture.
 471 }
 472 
 473 ////////////////////////////////////////////////////////////////////////////////
 474 // thread stack
 475 
 476 // These sizes exclude OS stack guard pages, but include
 477 // the VM guard pages.
 478 size_t os::Posix::_compiler_thread_min_stack_allowed = 128 * K;
 479 size_t os::Posix::_java_thread_min_stack_allowed = 128 * K;
 480 size_t os::Posix::_vm_internal_thread_min_stack_allowed = 128 * K;
 481 
 482 // Return default stack size for thr_type.
 483 size_t os::Posix::default_stack_size(os::ThreadType thr_type) {
 484   // Default stack size (compiler thread needs larger stack).
 485   size_t s = (thr_type == os::compiler_thread ? 4 * M : 1024 * K);
 486   return s;
 487 }
 488 
 489 size_t os::Linux::default_guard_size(os::ThreadType thr_type) {
 490   // Creating guard page is very expensive. Java thread has HotSpot
 491   // guard page, only enable glibc guard page for non-Java threads.
 492   return (thr_type == java_thread ? 0 : page_size());
 493 }
 494 
 495 // Java thread:
 496 //
 497 //   Low memory addresses
 498 //    +------------------------+
 499 //    |                        |\
 500 //    |    glibc guard page    | - Right in the middle of stack, 2 pages
 501 //    |                        |/
 502 // P1 +------------------------+ Thread::stack_base() - Thread::stack_size()
 503 //    |                        |\
 504 //    |  HotSpot Guard Pages   | - red and yellow pages
 505 //    |                        |/
 506 //    +------------------------+ JavaThread::stack_yellow_zone_base()
 507 //    |                        |\
 508 //    |      Normal Stack      | -
 509 //    |                        |/
 510 // P2 +------------------------+ Thread::stack_base()
 511 //
 512 // Non-Java thread:




 456   ShouldNotReachHere();
 457   return false;
 458 }
 459 
 460 void os::Linux::init_thread_fpu_state(void) {
 461   // Nothing to do on z/Architecture.
 462 }
 463 
 464 int os::Linux::get_fpu_control_word(void) {
 465   // Nothing to do on z/Architecture.
 466   return 0;
 467 }
 468 
 469 void os::Linux::set_fpu_control_word(int fpu_control) {
 470   // Nothing to do on z/Architecture.
 471 }
 472 
 473 ////////////////////////////////////////////////////////////////////////////////
 474 // thread stack
 475 
 476 // Minimum usable stack sizes required to get to user code. Space for VM
 477 // guard pages is added later.
 478 size_t os::Posix::_compiler_thread_min_stack_allowed = (52 DEBUG_ONLY(+32)) * K;
 479 size_t os::Posix::_java_thread_min_stack_allowed = (32 DEBUG_ONLY(+8)) * K;
 480 size_t os::Posix::_vm_internal_thread_min_stack_allowed = 32 * K;
 481 
 482 // Return default stack size for thr_type.
 483 size_t os::Posix::default_stack_size(os::ThreadType thr_type) {
 484   // Default stack size (compiler thread needs larger stack).
 485   size_t s = (thr_type == os::compiler_thread ? 4 * M : 1024 * K);
 486   return s;
 487 }
 488 
 489 size_t os::Linux::default_guard_size(os::ThreadType thr_type) {
 490   // Creating guard page is very expensive. Java thread has HotSpot
 491   // guard page, only enable glibc guard page for non-Java threads.
 492   return ((thr_type == java_thread || thr_type == os::compiler_thread) ? 0 : page_size());
 493 }
 494 
 495 // Java thread:
 496 //
 497 //   Low memory addresses
 498 //    +------------------------+
 499 //    |                        |\
 500 //    |    glibc guard page    | - Right in the middle of stack, 2 pages
 501 //    |                        |/
 502 // P1 +------------------------+ Thread::stack_base() - Thread::stack_size()
 503 //    |                        |\
 504 //    |  HotSpot Guard Pages   | - red and yellow pages
 505 //    |                        |/
 506 //    +------------------------+ JavaThread::stack_yellow_zone_base()
 507 //    |                        |\
 508 //    |      Normal Stack      | -
 509 //    |                        |/
 510 // P2 +------------------------+ Thread::stack_base()
 511 //
 512 // Non-Java thread:


< prev index next >