aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime
diff options
context:
space:
mode:
authorDmitriy Vyukov <dvyukov@google.com>2014-08-16 09:07:55 +0400
committerDmitriy Vyukov <dvyukov@google.com>2014-08-16 09:07:55 +0400
commitc6fe53a230e70bbb7a5582afe96cacf174eb0335 (patch)
tree09dc7204610f11bedace8deab9f4df42b8c5b1b9 /src/pkg/runtime
parent78cc89ce6740057bfbf9da211102c75659f83c89 (diff)
downloadgo-c6fe53a230e70bbb7a5582afe96cacf174eb0335.tar.xz
runtime: mark with non-atomic operations when GOMAXPROCS=1
Perf builders show 3-5% GC pause increase with GOMAXPROCS=1 when marking with atomic ops: http://goperfd.appspot.com/perfdetail?commit=a8a6e765d6a87f7ccb71fd85a60eb5a821151f85&commit0=3b864e02b987171e05e2e9d0840b85b5b6476386&kind=builder&builder=linux-amd64&benchmark=http LGTM=rlh R=golang-codereviews, rlh CC=dave, golang-codereviews, khr, rsc https://golang.org/cl/128340043
Diffstat (limited to 'src/pkg/runtime')
-rw-r--r--src/pkg/runtime/mgc0.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/pkg/runtime/mgc0.c b/src/pkg/runtime/mgc0.c
index 59dfd51e65..f46d329017 100644
--- a/src/pkg/runtime/mgc0.c
+++ b/src/pkg/runtime/mgc0.c
@@ -451,7 +451,8 @@ scanblock(byte *b, uintptr n, byte *ptrmask)
// quadruple is already marked. Otherwise we resort to CAS
// loop for marking.
bits8 = xbits>>(shift&~7);
- if((bits8&(bitMask|(bitMask<<gcBits))) != (bitBoundary|(bitBoundary<<gcBits)))
+ if((bits8&(bitMask|(bitMask<<gcBits))) != (bitBoundary|(bitBoundary<<gcBits)) ||
+ work.nproc == 1)
((uint8*)bitp)[shift/8] = bits8 | (bitMarked<<(shift&7));
else {
for(;;) {