From c6fe53a230e70bbb7a5582afe96cacf174eb0335 Mon Sep 17 00:00:00 2001 From: Dmitriy Vyukov Date: Sat, 16 Aug 2014 09:07:55 +0400 Subject: [PATCH] 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 --- src/pkg/runtime/mgc0.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pkg/runtime/mgc0.c b/src/pkg/runtime/mgc0.c index 59dfd51e65c..f46d329017f 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<