--- old/src/os/aix/vm/os_aix.cpp 2015-08-03 01:38:50.217155176 -0400 +++ new/src/os/aix/vm/os_aix.cpp 2015-08-03 01:38:48.949083134 -0400 @@ -971,34 +971,32 @@ guarantee(pthread_attr_setsuspendstate_np(&attr, PTHREAD_CREATE_SUSPENDED_NP) == 0, "???"); // calculate stack size if it's not specified by caller - if (os::Aix::supports_variable_stack_size()) { - if (stack_size == 0) { - stack_size = os::Aix::default_stack_size(thr_type); + if (stack_size == 0) { + stack_size = os::Aix::default_stack_size(thr_type); - switch (thr_type) { - case os::java_thread: - // Java threads use ThreadStackSize whose default value can be changed with the flag -Xss. - assert(JavaThread::stack_size_at_create() > 0, "this should be set"); - stack_size = JavaThread::stack_size_at_create(); + switch (thr_type) { + case os::java_thread: + // Java threads use ThreadStackSize whose default value can be changed with the flag -Xss. + assert(JavaThread::stack_size_at_create() > 0, "this should be set"); + stack_size = JavaThread::stack_size_at_create(); + break; + case os::compiler_thread: + if (CompilerThreadStackSize > 0) { + stack_size = (size_t)(CompilerThreadStackSize * K); break; - case os::compiler_thread: - if (CompilerThreadStackSize > 0) { - stack_size = (size_t)(CompilerThreadStackSize * K); - break; - } // else fall through: - // use VMThreadStackSize if CompilerThreadStackSize is not defined - case os::vm_thread: - case os::pgc_thread: - case os::cgc_thread: - case os::watcher_thread: - if (VMThreadStackSize > 0) stack_size = (size_t)(VMThreadStackSize * K); - break; - } + } // else fall through: + // use VMThreadStackSize if CompilerThreadStackSize is not defined + case os::vm_thread: + case os::pgc_thread: + case os::cgc_thread: + case os::watcher_thread: + if (VMThreadStackSize > 0) stack_size = (size_t)(VMThreadStackSize * K); + break; } + } - stack_size = MAX2(stack_size, os::Aix::min_stack_allowed); - pthread_attr_setstacksize(&attr, stack_size); - } //else let thread_create() pick the default value (96 K on AIX) + stack_size = MAX2(stack_size, os::Aix::min_stack_allowed); + pthread_attr_setstacksize(&attr, stack_size); pthread_t tid; int ret = pthread_create(&tid, &attr, (void* (*)(void*)) java_start, thread); --- old/src/os/aix/vm/os_aix.hpp 2015-08-03 01:38:54.209381982 -0400 +++ new/src/os/aix/vm/os_aix.hpp 2015-08-03 01:38:52.945310167 -0400 @@ -131,8 +131,6 @@ static void initialize_libo4(); static void initialize_libperfstat(); - static bool supports_variable_stack_size(); - public: static void init_thread_fpu_state(); static pthread_t main_thread(void) { return _main_thread; } --- old/src/os/bsd/vm/os_bsd.cpp 2015-08-03 01:38:58.113603790 -0400 +++ new/src/os/bsd/vm/os_bsd.cpp 2015-08-03 01:38:56.849531975 -0400 @@ -739,40 +739,35 @@ pthread_attr_init(&attr); pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); - // stack size - if (os::Bsd::supports_variable_stack_size()) { - // calculate stack size if it's not specified by caller - if (stack_size == 0) { - stack_size = os::Bsd::default_stack_size(thr_type); + // calculate stack size if it's not specified by caller + if (stack_size == 0) { + stack_size = os::Bsd::default_stack_size(thr_type); - switch (thr_type) { - case os::java_thread: - // Java threads use ThreadStackSize which default value can be - // changed with the flag -Xss - assert(JavaThread::stack_size_at_create() > 0, "this should be set"); - stack_size = JavaThread::stack_size_at_create(); + switch (thr_type) { + case os::java_thread: + // Java threads use ThreadStackSize which default value can be + // changed with the flag -Xss + assert(JavaThread::stack_size_at_create() > 0, "this should be set"); + stack_size = JavaThread::stack_size_at_create(); + break; + case os::compiler_thread: + if (CompilerThreadStackSize > 0) { + stack_size = (size_t)(CompilerThreadStackSize * K); break; - case os::compiler_thread: - if (CompilerThreadStackSize > 0) { - stack_size = (size_t)(CompilerThreadStackSize * K); - break; - } // else fall through: - // use VMThreadStackSize if CompilerThreadStackSize is not defined - case os::vm_thread: - case os::pgc_thread: - case os::cgc_thread: - case os::watcher_thread: - if (VMThreadStackSize > 0) stack_size = (size_t)(VMThreadStackSize * K); - break; - } + } // else fall through: + // use VMThreadStackSize if CompilerThreadStackSize is not defined + case os::vm_thread: + case os::pgc_thread: + case os::cgc_thread: + case os::watcher_thread: + if (VMThreadStackSize > 0) stack_size = (size_t)(VMThreadStackSize * K); + break; } - - stack_size = MAX2(stack_size, os::Bsd::min_stack_allowed); - pthread_attr_setstacksize(&attr, stack_size); - } else { - // let pthread_create() pick the default value. } + stack_size = MAX2(stack_size, os::Bsd::min_stack_allowed); + pthread_attr_setstacksize(&attr, stack_size); + ThreadState state; { --- old/src/os/bsd/vm/os_bsd.hpp 2015-08-03 01:39:02.089829690 -0400 +++ new/src/os/bsd/vm/os_bsd.hpp 2015-08-03 01:39:00.825757874 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -75,8 +75,6 @@ static julong physical_memory() { return _physical_memory; } static void initialize_system_info(); - static bool supports_variable_stack_size(); - static void rebuild_cpu_to_node_map(); static GrowableArray* cpu_to_node() { return _cpu_to_node; } --- old/src/os/linux/vm/os_linux.cpp 2015-08-03 01:39:06.002051954 -0400 +++ new/src/os/linux/vm/os_linux.cpp 2015-08-03 01:39:04.745980593 -0400 @@ -711,39 +711,35 @@ pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); // stack size - if (os::Linux::supports_variable_stack_size()) { - // calculate stack size if it's not specified by caller - if (stack_size == 0) { - stack_size = os::Linux::default_stack_size(thr_type); + // calculate stack size if it's not specified by caller + if (stack_size == 0) { + stack_size = os::Linux::default_stack_size(thr_type); - switch (thr_type) { - case os::java_thread: - // Java threads use ThreadStackSize which default value can be - // changed with the flag -Xss - assert(JavaThread::stack_size_at_create() > 0, "this should be set"); - stack_size = JavaThread::stack_size_at_create(); + switch (thr_type) { + case os::java_thread: + // Java threads use ThreadStackSize which default value can be + // changed with the flag -Xss + assert(JavaThread::stack_size_at_create() > 0, "this should be set"); + stack_size = JavaThread::stack_size_at_create(); + break; + case os::compiler_thread: + if (CompilerThreadStackSize > 0) { + stack_size = (size_t)(CompilerThreadStackSize * K); break; - case os::compiler_thread: - if (CompilerThreadStackSize > 0) { - stack_size = (size_t)(CompilerThreadStackSize * K); - break; - } // else fall through: - // use VMThreadStackSize if CompilerThreadStackSize is not defined - case os::vm_thread: - case os::pgc_thread: - case os::cgc_thread: - case os::watcher_thread: - if (VMThreadStackSize > 0) stack_size = (size_t)(VMThreadStackSize * K); - break; - } + } // else fall through: + // use VMThreadStackSize if CompilerThreadStackSize is not defined + case os::vm_thread: + case os::pgc_thread: + case os::cgc_thread: + case os::watcher_thread: + if (VMThreadStackSize > 0) stack_size = (size_t)(VMThreadStackSize * K); + break; } - - stack_size = MAX2(stack_size, os::Linux::min_stack_allowed); - pthread_attr_setstacksize(&attr, stack_size); - } else { - // let pthread_create() pick the default value. } + stack_size = MAX2(stack_size, os::Linux::min_stack_allowed); + pthread_attr_setstacksize(&attr, stack_size); + // glibc guard page pthread_attr_setguardsize(&attr, os::Linux::default_guard_size(thr_type)); --- old/src/os/linux/vm/os_linux.hpp 2015-08-03 01:39:10.198290355 -0400 +++ new/src/os/linux/vm/os_linux.hpp 2015-08-03 01:39:08.706205586 -0400 @@ -83,8 +83,6 @@ static void set_glibc_version(const char *s) { _glibc_version = s; } static void set_libpthread_version(const char *s) { _libpthread_version = s; } - static bool supports_variable_stack_size(); - static void rebuild_cpu_to_node_map(); static GrowableArray* cpu_to_node() { return _cpu_to_node; } --- old/src/os_cpu/aix_ppc/vm/os_aix_ppc.cpp 2015-08-03 01:39:14.250520577 -0400 +++ new/src/os_cpu/aix_ppc/vm/os_aix_ppc.cpp 2015-08-03 01:39:12.946446490 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright 2012, 2014 SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -489,10 +489,6 @@ size_t os::Aix::min_stack_allowed = 128*K; -// Aix is always in floating stack mode. The stack size for a new -// thread can be set via pthread_attr_setstacksize(). -bool os::Aix::supports_variable_stack_size() { return true; } - // return default stack size for thr_type size_t os::Aix::default_stack_size(os::ThreadType thr_type) { // default stack size (compiler thread needs larger stack) --- old/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp 2015-08-03 01:39:18.254748074 -0400 +++ new/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp 2015-08-03 01:39:16.998676709 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -780,9 +780,6 @@ #ifdef AMD64 size_t os::Bsd::min_stack_allowed = 64 * K; - -// amd64: pthread on amd64 is always in floating stack mode -bool os::Bsd::supports_variable_stack_size() { return true; } #else size_t os::Bsd::min_stack_allowed = (48 DEBUG_ONLY(+4))*K; @@ -790,7 +787,6 @@ #define GET_GS() ({int gs; __asm__ volatile("movw %%gs, %w0":"=q"(gs)); gs&0xffff;}) #endif -bool os::Bsd::supports_variable_stack_size() { return true; } #endif // AMD64 // return default stack size for thr_type --- old/src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp 2015-08-03 01:39:22.190971706 -0400 +++ new/src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp 2015-08-03 01:39:20.938900569 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -290,10 +290,6 @@ size_t os::Bsd::min_stack_allowed = 64 * K; -bool os::Bsd::supports_variable_stack_size() { - return true; -} - size_t os::Bsd::default_stack_size(os::ThreadType thr_type) { #ifdef _LP64 size_t s = (thr_type == os::compiler_thread ? 4 * M : 1 * M); --- old/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp 2015-08-03 01:39:26.359208520 -0400 +++ new/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp 2015-08-03 01:39:25.095136702 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -496,9 +496,6 @@ size_t os::Linux::min_stack_allowed = 64 * K; -// aarch64: pthread on aarch64 is always in floating stack mode -bool os::Linux::supports_variable_stack_size() { return true; } - // return default stack size for thr_type size_t os::Linux::default_stack_size(os::ThreadType thr_type) { // default stack size (compiler thread needs larger stack) --- old/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp 2015-08-03 01:39:30.371436473 -0400 +++ new/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp 2015-08-03 01:39:29.119365339 -0400 @@ -467,8 +467,6 @@ size_t os::Linux::min_stack_allowed = 128*K; -bool os::Linux::supports_variable_stack_size() { return true; } - // return default stack size for thr_type size_t os::Linux::default_stack_size(os::ThreadType thr_type) { // default stack size (compiler thread needs larger stack) --- old/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp 2015-08-03 01:39:35.915751472 -0400 +++ new/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp 2015-08-03 01:39:34.651679654 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -733,9 +733,6 @@ size_t os::Linux::min_stack_allowed = 128 * K; -// pthread on Ubuntu is always in floating stack mode -bool os::Linux::supports_variable_stack_size() { return true; } - // return default stack size for thr_type size_t os::Linux::default_stack_size(os::ThreadType thr_type) { // default stack size (compiler thread needs larger stack) --- old/src/os_cpu/linux_x86/vm/os_linux_x86.cpp 2015-08-03 01:39:39.859975564 -0400 +++ new/src/os_cpu/linux_x86/vm/os_linux_x86.cpp 2015-08-03 01:39:38.579902837 -0400 @@ -623,11 +623,6 @@ size_t os::Linux::min_stack_allowed = (48 DEBUG_ONLY(+4))*K; #endif // AMD64 -// Test if pthread library can support variable thread stack size. -bool os::Linux::supports_variable_stack_size() { - return true; -} - // return default stack size for thr_type size_t os::Linux::default_stack_size(os::ThreadType thr_type) { // default stack size (compiler thread needs larger stack) --- old/src/os_cpu/linux_zero/vm/os_linux_zero.cpp 2015-08-03 01:39:43.820200566 -0400 +++ new/src/os_cpu/linux_zero/vm/os_linux_zero.cpp 2015-08-03 01:39:42.572129656 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -305,10 +305,6 @@ size_t os::Linux::min_stack_allowed = 64 * K; -bool os::Linux::supports_variable_stack_size() { - return true; -} - size_t os::Linux::default_stack_size(os::ThreadType thr_type) { #ifdef _LP64 size_t s = (thr_type == os::compiler_thread ? 4 * M : 1 * M);