aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/runtime2.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2015-03-08 20:56:15 -0400
committerRuss Cox <rsc@golang.org>2015-03-20 00:02:30 +0000
commit564eab891a2a0da77aeec29d94a5a4c0c9d002b8 (patch)
tree5cf775727aa1f454a9c609b4a52ce446b19f6aaa /src/runtime/runtime2.go
parent01af72705255fbb48ea3ff3558766537dd0a8ee0 (diff)
downloadgo-564eab891a2a0da77aeec29d94a5a4c0c9d002b8.tar.xz
runtime: add GODEBUG=sbrk=1 to bypass memory allocator (and GC)
To reduce lock contention in this mode, makes persistent allocation state per-P, which means at most 64 kB overhead x $GOMAXPROCS, which should be completely tolerable. Change-Id: I34ca95e77d7e67130e30822e5a4aff6772b1a1c5 Reviewed-on: https://go-review.googlesource.com/7740 Reviewed-by: Rick Hudson <rlh@golang.org>
Diffstat (limited to 'src/runtime/runtime2.go')
-rw-r--r--src/runtime/runtime2.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/runtime/runtime2.go b/src/runtime/runtime2.go
index 6604b9920c..9ea3fd197f 100644
--- a/src/runtime/runtime2.go
+++ b/src/runtime/runtime2.go
@@ -369,6 +369,8 @@ type p struct {
tracebuf *traceBuf
+ palloc persistentAlloc // per-P to avoid mutex
+
pad [64]byte
}