aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/defs_linux_arm.go
diff options
context:
space:
mode:
authorKeith Randall <khr@golang.org>2015-02-23 13:58:05 -0800
committerKeith Randall <khr@golang.org>2015-02-25 21:16:18 +0000
commit7e1b61c71840386a494a0a9f99cb7237112c1116 (patch)
tree31ddf6ddb37801ab1c6465a369355c711e433dc1 /src/runtime/defs_linux_arm.go
parent6d1ebeb5271a06cd55f55a84e95709e2f4805bcc (diff)
downloadgo-7e1b61c71840386a494a0a9f99cb7237112c1116.tar.gz
go-7e1b61c71840386a494a0a9f99cb7237112c1116.zip
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>
Diffstat (limited to 'src/runtime/defs_linux_arm.go')
-rw-r--r--src/runtime/defs_linux_arm.go21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/runtime/defs_linux_arm.go b/src/runtime/defs_linux_arm.go
index 3940240898..b68b9642a9 100644
--- a/src/runtime/defs_linux_arm.go
+++ b/src/runtime/defs_linux_arm.go
@@ -6,14 +6,19 @@ const (
_ENOMEM = 0xc
_EAGAIN = 0xb
- _PROT_NONE = 0
- _PROT_READ = 0x1
- _PROT_WRITE = 0x2
- _PROT_EXEC = 0x4
- _MAP_ANON = 0x20
- _MAP_PRIVATE = 0x2
- _MAP_FIXED = 0x10
- _MADV_DONTNEED = 0x4
+ _PROT_NONE = 0
+ _PROT_READ = 0x1
+ _PROT_WRITE = 0x2
+ _PROT_EXEC = 0x4
+
+ _MAP_ANON = 0x20
+ _MAP_PRIVATE = 0x2
+ _MAP_FIXED = 0x10
+
+ _MADV_DONTNEED = 0x4
+ _MADV_HUGEPAGE = 0xe
+ _MADV_NOHUGEPAGE = 0xf
+
_SA_RESTART = 0x10000000
_SA_ONSTACK = 0x8000000
_SA_RESTORER = 0 // unused on ARM