Why aarch64 has 2x stack size vs x64

Andrew Haley aph-open at littlepinkcloud.com
Tue Feb 21 17:53:35 UTC 2023


On 2/21/23 16:56, Vladimir Kozlov wrote:
> Can you tell why aarch64 requires twice as much stack size (ThreadStackSize and others) vs x64?
> Is it mostly because it has more registers you need to save on calls?
> 
> This question rose after discussion in recent PR [1]

When I made this change we were still sometimes running on a simulator, where half
of the stack space was used by the x86 host and the other half by the (simulated)
target. In order to have as much stack space as we needed we doubled the size.

When it came time to merge with mainline, I didn't change the stack size back
because I didn't think it was worth the risk. The additional address space cost
almost nothing: Linux only allocates stack on demand.

AArch64 does use _slightly_ more stack, but it's not much. We could change it to
be the same as x64.

-- 
Andrew Haley  (he/him)
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
https://keybase.io/andrewhaley
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671



More information about the hotspot-compiler-dev mailing list