< prev index next >

src/os_cpu/linux_aarch64/vm/os_linux_aarch64.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 int os::Linux::get_fpu_control_word(void) {
 457   return 0;
 458 }
 459 
 460 void os::Linux::set_fpu_control_word(int fpu_control) {
 461 }
 462 
 463 // Check that the linux kernel version is 2.4 or higher since earlier
 464 // versions do not support SSE without patches.
 465 bool os::supports_sse() {
 466   return true;
 467 }
 468 
 469 bool os::is_allocatable(size_t bytes) {
 470   return true;
 471 }
 472 
 473 ////////////////////////////////////////////////////////////////////////////////
 474 // thread stack
 475 
 476 size_t os::Posix::_compiler_thread_min_stack_allowed = 64 * K;
 477 size_t os::Posix::_java_thread_min_stack_allowed = 64 * K;


 478 size_t os::Posix::_vm_internal_thread_min_stack_allowed = 64 * K;
 479 
 480 // return default stack size for thr_type
 481 size_t os::Posix::default_stack_size(os::ThreadType thr_type) {
 482   // default stack size (compiler thread needs larger stack)
 483   size_t s = (thr_type == os::compiler_thread ? 4 * M : 1 * M);
 484   return s;
 485 }
 486 
 487 size_t os::Linux::default_guard_size(os::ThreadType thr_type) {
 488   // Creating guard page is very expensive. Java thread has HotSpot
 489   // guard page, only enable glibc guard page for non-Java threads.
 490   return (thr_type == java_thread ? 0 : page_size());
 491 }
 492 
 493 // Java thread:
 494 //
 495 //   Low memory addresses
 496 //    +------------------------+
 497 //    |                        |\  JavaThread created by VM does not have glibc
 498 //    |    glibc guard page    | - guard, attached Java thread usually has
 499 //    |                        |/  1 page glibc guard.
 500 // P1 +------------------------+ Thread::stack_base() - Thread::stack_size()
 501 //    |                        |\
 502 //    |  HotSpot Guard Pages   | - red and yellow pages
 503 //    |                        |/
 504 //    +------------------------+ JavaThread::stack_yellow_zone_base()
 505 //    |                        |\
 506 //    |      Normal Stack      | -
 507 //    |                        |/
 508 // P2 +------------------------+ Thread::stack_base()
 509 //
 510 // Non-Java thread:




 456 int os::Linux::get_fpu_control_word(void) {
 457   return 0;
 458 }
 459 
 460 void os::Linux::set_fpu_control_word(int fpu_control) {
 461 }
 462 
 463 // Check that the linux kernel version is 2.4 or higher since earlier
 464 // versions do not support SSE without patches.
 465 bool os::supports_sse() {
 466   return true;
 467 }
 468 
 469 bool os::is_allocatable(size_t bytes) {
 470   return true;
 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 = 32 * K;
 479 size_t os::Posix::_java_thread_min_stack_allowed = 32 * K;
 480 size_t os::Posix::_vm_internal_thread_min_stack_allowed = 64 * 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 : 1 * M);
 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 //    |                        |\  JavaThread created by VM does not have glibc
 500 //    |    glibc guard page    | - guard, attached Java thread usually has
 501 //    |                        |/  1 page glibc guard.
 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 >