On 2013-02-14 18:52, minux wrote:
> please send gccgo CLs to the gofrontend-dev ML.
Oops, sorry. I did not know about this list. It is not mentioned at the
relevant page:
http://golang.org/doc/gccgo_contribute.html
> i think we'd better patch this to master Go runtime as it's not specific
> to gccgo runtime.
>
> add the macro definition to pkg/runtime/defs_linux_{386,amd64,arm}.h and
> pkg/runtime/defs_linux.go
> and then use it in pkg/runtime/mem_linux.c.
>
> PS: if you're sure the value of the macro is uniform across all
> architectures supported
> by Linux, you could add the definition to os_linux.h instead of defs_linux*.
I tried this out on 32 bit Linux and it did not solve any problem there
even if running with "vm.overcommit_memory=2" (which should disable
memory overcommit).
The mmap() without MAP_NORESERVE does not seem to reserve the swap space
on Linux (which seems to contradict with the mmap(2) manual page). The
flag makes no difference there. I am able to start a big amount of Go
program processes even when the overcommit is disabled.
The virtual memory consumption number in ps output (VSZ) and the "pmap
PID" output remains the same no matter if this flag is specified or not.
Therefore I thought I should not suggest patching mem_linux.c.
--
Janne Snabb / EPIPE Communications
sn...@epipe.com -
http://epipe.com/