[ppc] Default stack size on ppc64
Richard W.M. Jones
rjones at redhat.com
Wed Mar 25 17:54:58 UTC 2015
On Tue, Mar 24, 2015 at 11:35:30AM -0500, Steven Munroe wrote:
> On Tue, 2015-03-24 at 12:19 +0000, Richard W.M. Jones wrote:
> > For the OCaml packages on ppc64/ppc64le, we keep having bugs like this
> > one: https://bugzilla.redhat.com/show_bug.cgi?id=1204876
> > The OCaml compiler is quite recursive, and so it can easily overflow
> > the default stack. For reasons that are not entirely clear this
> > happens only on ppc64/ppc64le (not on x86 or aarch64). Perhaps POWER
> > stack frames are bigger, or the default stack size is smaller.
> The default thread stack is 8MB-64KB plus a 64KB guard page. PPC uses a
> 64K default page size.
> So there are two possible problems:
> 1) running into the guard page for a single thread.
> 2) the sum of all thread stacks exceeds the ulimit -s
The OCaml compiler is single threaded AFAIK.
> If changing the ulimit -s solves the problem the sum of all thread
> stacks has exceeded the ulimit.
> If in cases where increasing the ulimit -s to unlimited does no help
> then you have at least one thread that has overflowed the default stack.
> Power has lots of registers (32x64b GPRs + 32x64b FPRs + 32x128b VRs) so
> we are likely to need a bigger stack frame at each level. The minimums
> are 112 bytes for ELF V1 ABI (PPC64BE) and 48 for ELF V2 ABI (PPC64LE),
> but any interesting function will need additional space to spill
> non-volatiles across function calls and store any local variables.
> You (ocaml runtime) can control the stack size on a per thread basis via
> I am not sure how ocaml is generating code for PPC64, you could look in
> to split stack support,
OCaml uses its own code generator. However the description of
-fsplit-stack from GCC sounds interesting. Are there any more details
of how exactly it works? Does it catch the segfault from hitting the
guard page and do something clever?
> but at this time GCC does not implement split
Did you mean "does implement"? GCC 5 documents it at least ...
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-p2v converts physical machines to virtual machines. Boot with a
live CD or over the network (PXE) and turn machines into KVM guests.
More information about the devel