runtime: If no split stacks, allocate stacks using mmap on 64-bit systems.
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 31 Oct 2015 23:48:19 +0000 (23:48 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 31 Oct 2015 23:48:19 +0000 (23:48 +0000)
commitf95e4bbfa73feda73d8eb128cc2e3d4866438c78
tree9c767b63079e2f30d1689cd0eade8669a97ec459
parent05e45616b5423725707bd9bcdd3187c82cc15625
runtime: If no split stacks, allocate stacks using mmap on 64-bit systems.

    When not using split stacks, libgo allocate large stacks for each
    goroutine.  On a 64-bit system, libgo allocates a maximum of 128G for
    the Go heap, and allocates 4M for each stack.  When the stacks are
    allocated from the Go heap, the result is that a program can only create
    32K goroutines, which is not enough for an active Go server.  This patch
    changes libgo to allocate the stacks using mmap directly, rather than
    allocating them out of the Go heap.  This change is only done for 64-bit
    systems when not using split stacks.  When using split stacks, the
    stacks are allocated using mmap directly anyhow.  On a 32-bit system,
    there is no maximum size for the Go heap, or, rather, the maximum size
    is the available address space anyhow.

    Reviewed-on: https://go-review.googlesource.com/16531

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229636 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/go/gofrontend/MERGE
libgo/runtime/proc.c