]> Cypherpunks repositories - gostls13.git/commit
runtime: mark pages we return to kernel as NOHUGEPAGE
authorKeith Randall <khr@golang.org>
Mon, 23 Feb 2015 21:58:05 +0000 (13:58 -0800)
committerKeith Randall <khr@golang.org>
Wed, 25 Feb 2015 21:16:18 +0000 (21:16 +0000)
commit7e1b61c71840386a494a0a9f99cb7237112c1116
tree31ddf6ddb37801ab1c6465a369355c711e433dc1
parent6d1ebeb5271a06cd55f55a84e95709e2f4805bcc
runtime: mark pages we return to kernel as NOHUGEPAGE

We return memory to the kernel with madvise(..., DONTNEED).
Also mark returned memory with NOHUGEPAGE to keep the kernel from
merging this memory into a huge page, effectively reallocating it.

Only known to be a problem on linux/{386,amd64,amd64p32} at the moment.
It may come up on other os/arch combinations in the future.

Fixes #8832

Change-Id: Ifffc6627a0296926e3f189a8a9b6e4bdb54c79eb
Reviewed-on: https://go-review.googlesource.com/5660
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
12 files changed:
src/runtime/arch1_386.go
src/runtime/arch1_amd64.go
src/runtime/arch1_amd64p32.go
src/runtime/arch1_arm.go
src/runtime/arch1_ppc64.go
src/runtime/arch1_ppc64le.go
src/runtime/defs_linux_386.go
src/runtime/defs_linux_amd64.go
src/runtime/defs_linux_arm.go
src/runtime/defs_linux_ppc64.go
src/runtime/defs_linux_ppc64le.go
src/runtime/mem_linux.go