8173339: AArch64: Fix minimum stack size computations

Andrew Dinn adinn at redhat.com
Fri Jan 27 11:21:43 UTC 2017


On 27/01/17 06:10, Lindenmaier, Goetz wrote:
> You need to adapt these for aarch in os_cpu_linux_aarch.cpp
> size_t os::Posix::_compiler_thread_min_stack_allowed = 32 * K;
> size_t os::Posix::_java_thread_min_stack_allowed = 32 * K;
> size_t os::Posix::_vm_internal_thread_min_stack_allowed = 64 * K;
> 
> See also http://hg.openjdk.java.net/jdk9/hs/hotspot/rev/c7a256349729
> Try with 
> -XX:ThreadStackSize
> -XX:CompilerThreadStackSize
> -XX:VMThreadStackSize
> You probably need to increase the values by 40K as you pass 320 but need 360K.
> Guard pages are added to these values.

Ah, ok. I saw that part of your patch (where you lowered the ppc values)
but I had assumed that the numbers for AArch64 would still be reasonable
(it uses 64k for vm threads but only 32k for java and compiler threads).
Fixing this turned out to be a bit of a black art but bumping them all
up to 72K works.

I found that the transition point where java -Xss<n> Hello switches from
failing with a StackOverflow to running successfully happens when rising
from n=340K to n=344K. So, it seemed that an increase of >= 24K would
suffice. Hence, I reasoned that upping the java and compiler min_stack
sizes to 64K (increase by 32K) ought to fix the test failure.

However, with that patch in place nothing actually changes:

  -Xss16 still reports that 320K is the minimum required stack
  test TooSmallStackSize still fails
  Hello still transitions from StackOverflow to ok at 340K --> 344K

So, I then followed your advice and upped all 3 min_stack sizes to 72K

  -Xss16 now reports that 384K (??) is the minimum required stack
  test TooSmallStackSize passes
  The VM rejects Hello run with -Xss380K but it runs ok with -Xss384K

So, it looks like we are stuck with a Java thread stack minimum of 384K.

I have raised JDK-8173473 to fix this. I could post a patch against
jdk9-dev but I'm unsure whether it is ok for it to go into JDK9 or
whether it needs to wait for JDK10?

regards,


Andrew Dinn
-----------
Senior Principal Software Engineer
Red Hat UK Ltd
Registered in England and Wales under Company Registration No. 03798903
Directors: Michael Cunningham, Michael ("Mike") O'Neill, Eric Shander


More information about the jdk9-dev mailing list