< prev index next >

src/os_cpu/linux_s390/vm/os_linux_s390.cpp

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


 449   ShouldNotReachHere();
 450   return false;
 451 }
 452 
 453 void os::Linux::init_thread_fpu_state(void) {
 454   // Nothing to do on z/Architecture.
 455 }
 456 
 457 int os::Linux::get_fpu_control_word(void) {
 458   // Nothing to do on z/Architecture.
 459   return 0;
 460 }
 461 
 462 void os::Linux::set_fpu_control_word(int fpu_control) {
 463   // Nothing to do on z/Architecture.
 464 }
 465 
 466 ////////////////////////////////////////////////////////////////////////////////
 467 // thread stack
 468 


 469 size_t os::Posix::_compiler_thread_min_stack_allowed = 128 * K;
 470 size_t os::Posix::_java_thread_min_stack_allowed = 128 * K;
 471 size_t os::Posix::_vm_internal_thread_min_stack_allowed = 128 * K;
 472 
 473 // return default stack size for thr_type
 474 size_t os::Posix::default_stack_size(os::ThreadType thr_type) {
 475   // default stack size (compiler thread needs larger stack)
 476   size_t s = (thr_type == os::compiler_thread ? 4 * M : 1024 * K);
 477   return s;
 478 }
 479 
 480 size_t os::Linux::default_guard_size(os::ThreadType thr_type) {
 481   // z/Architecture: put 2 guard pages right in the middle of thread stack. This value
 482   // should be consistent with the value used by register stack handling code.
 483   return 2 * page_size();
 484 }
 485 
 486 // Java thread:
 487 //
 488 //   Low memory addresses
 489 //    +------------------------+
 490 //    |                        |\
 491 //    |    glibc guard page    | - Right in the middle of stack, 2 pages
 492 //    |                        |/
 493 // P1 +------------------------+ Thread::stack_base() - Thread::stack_size()
 494 //    |                        |\
 495 //    |  HotSpot Guard Pages   | - red and yellow pages
 496 //    |                        |/
 497 //    +------------------------+ JavaThread::stack_yellow_zone_base()
 498 //    |                        |\
 499 //    |      Normal Stack      | -
 500 //    |                        |/
 501 // P2 +------------------------+ Thread::stack_base()
 502 //
 503 // Non-Java thread:




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


< prev index next >