< prev index next >

src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp

Print this page
rev 12346 : 8169373: Work around linux NPTL stack guard error.
Summary: Also skip libc guard page for compiler thread, merge similar code on linux platforms, and streamline libc guard page handling on linuxs390, linuxppc, aixppc.
Reviewed-by: dholmes, dcubed


 853 #endif
 854 
 855 #endif // AMD64
 856 
 857 // return default stack size for thr_type
 858 size_t os::Posix::default_stack_size(os::ThreadType thr_type) {
 859   // default stack size (compiler thread needs larger stack)
 860 #ifdef AMD64
 861   size_t s = (thr_type == os::compiler_thread ? 4 * M : 1 * M);
 862 #else
 863   size_t s = (thr_type == os::compiler_thread ? 2 * M : 512 * K);
 864 #endif // AMD64
 865   return s;
 866 }
 867 
 868 
 869 // Java thread:
 870 //
 871 //   Low memory addresses
 872 //    +------------------------+
 873 //    |                        |\  JavaThread created by VM does not have glibc
 874 //    |    glibc guard page    | - guard, attached Java thread usually has
 875 //    |                        |/  1 page glibc guard.
 876 // P1 +------------------------+ Thread::stack_base() - Thread::stack_size()
 877 //    |                        |\
 878 //    |  HotSpot Guard Pages   | - red and yellow pages
 879 //    |                        |/
 880 //    +------------------------+ JavaThread::stack_yellow_zone_base()
 881 //    |                        |\
 882 //    |      Normal Stack      | -
 883 //    |                        |/
 884 // P2 +------------------------+ Thread::stack_base()
 885 //
 886 // Non-Java thread:
 887 //
 888 //   Low memory addresses
 889 //    +------------------------+
 890 //    |                        |\
 891 //    |  glibc guard page      | - usually 1 page
 892 //    |                        |/
 893 // P1 +------------------------+ Thread::stack_base() - Thread::stack_size()
 894 //    |                        |\
 895 //    |      Normal Stack      | -
 896 //    |                        |/
 897 // P2 +------------------------+ Thread::stack_base()
 898 //
 899 // ** P1 (aka bottom) and size ( P2 = P1 - size) are the address and stack size returned from
 900 //    pthread_attr_getstack()




 853 #endif
 854 
 855 #endif // AMD64
 856 
 857 // return default stack size for thr_type
 858 size_t os::Posix::default_stack_size(os::ThreadType thr_type) {
 859   // default stack size (compiler thread needs larger stack)
 860 #ifdef AMD64
 861   size_t s = (thr_type == os::compiler_thread ? 4 * M : 1 * M);
 862 #else
 863   size_t s = (thr_type == os::compiler_thread ? 2 * M : 512 * K);
 864 #endif // AMD64
 865   return s;
 866 }
 867 
 868 
 869 // Java thread:
 870 //
 871 //   Low memory addresses
 872 //    +------------------------+
 873 //    |                        |\  Java thread created by VM does not have glibc
 874 //    |    glibc guard page    | - guard, attached Java thread usually has
 875 //    |                        |/  1 page glibc guard.
 876 // P1 +------------------------+ Thread::stack_base() - Thread::stack_size()
 877 //    |                        |\
 878 //    |  HotSpot Guard Pages   | - red, yellow and reserved pages
 879 //    |                        |/
 880 //    +------------------------+ JavaThread::stack_reserved_zone_base()
 881 //    |                        |\
 882 //    |      Normal Stack      | -
 883 //    |                        |/
 884 // P2 +------------------------+ Thread::stack_base()
 885 //
 886 // Non-Java thread:
 887 //
 888 //   Low memory addresses
 889 //    +------------------------+
 890 //    |                        |\
 891 //    |  glibc guard page      | - usually 1 page
 892 //    |                        |/
 893 // P1 +------------------------+ Thread::stack_base() - Thread::stack_size()
 894 //    |                        |\
 895 //    |      Normal Stack      | -
 896 //    |                        |/
 897 // P2 +------------------------+ Thread::stack_base()
 898 //
 899 // ** P1 (aka bottom) and size ( P2 = P1 - size) are the address and stack size returned from
 900 //    pthread_attr_getstack()


< prev index next >