< prev index next >
src/os_cpu/aix_ppc/vm/os_aix_ppc.cpp
Print this page
rev 12305 : 8169373: Work around linux NPTL stack guard error.
Summary: Also streamline OS guard page handling on linuxs390, linuxppc, aixppc.
*** 533,553 ****
}
////////////////////////////////////////////////////////////////////////////////
// thread stack
size_t os::Posix::_compiler_thread_min_stack_allowed = 128 * K;
size_t os::Posix::_java_thread_min_stack_allowed = 128 * K;
size_t os::Posix::_vm_internal_thread_min_stack_allowed = 128 * K;
! // return default stack size for thr_type
size_t os::Posix::default_stack_size(os::ThreadType thr_type) {
! // default stack size (compiler thread needs larger stack)
size_t s = (thr_type == os::compiler_thread ? 4 * M : 1 * M);
return s;
}
/////////////////////////////////////////////////////////////////////////////
// helper functions for fatal error handler
void os::print_context(outputStream *st, const void *context) {
if (context == NULL) return;
--- 533,567 ----
}
////////////////////////////////////////////////////////////////////////////////
// thread stack
+ // These sizes exclude OS stack guard pages, but include
+ // the VM guard pages.
size_t os::Posix::_compiler_thread_min_stack_allowed = 128 * K;
size_t os::Posix::_java_thread_min_stack_allowed = 128 * K;
size_t os::Posix::_vm_internal_thread_min_stack_allowed = 128 * K;
! // Return default stack size for thr_type.
size_t os::Posix::default_stack_size(os::ThreadType thr_type) {
! // Default stack size (compiler thread needs larger stack).
size_t s = (thr_type == os::compiler_thread ? 4 * M : 1 * M);
return s;
}
+ size_t os::Aix::default_guard_size(os::ThreadType thr_type) {
+ // Creating guard pages is very expensive. Java thread has HotSpot
+ // guard pages, so only enable libc guard pages for non-Java threads.
+ //
+ // Aix can have different page sizes for stack (4K) and heap (64K).
+ // As Hotspot knows only one page size, we assume the stack has
+ // the same page size as the heap. Returning page_size() here can
+ // cause 16 guard pages which we want to avoid. Thus we return 4K
+ // which will be rounded to the real page size by the OS.
+ return (thr_type == java_thread ? 0 : 4*K);
+ }
+
/////////////////////////////////////////////////////////////////////////////
// helper functions for fatal error handler
void os::print_context(outputStream *st, const void *context) {
if (context == NULL) return;
< prev index next >