From a15818fed3032d43e57c395c3fe8b46b37a5f1ea Mon Sep 17 00:00:00 2001 From: Rick Hudson Date: Thu, 5 Feb 2015 19:58:18 -0500 Subject: runtime: cache workbufs on Ms and add consistency checks Add local workbufs to the m struct in order to reduce contention. Add consistency checks for workbuf ownership. Chain workbufs through call change to avoid swapping them to and from the m struct. Adjust the size of the workbuf so that the mutators can more frequently pass modifications to the GC thus shifting some work from the STW mark termination phase to the concurrent mark phase. Change-Id: I557b53af34ad9972265e0ed9f5996e52d548563d Reviewed-on: https://go-review.googlesource.com/3972 Reviewed-by: Austin Clements --- src/runtime/malloc.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/runtime/malloc.go') diff --git a/src/runtime/malloc.go b/src/runtime/malloc.go index b8b1f4ed36..06ba124473 100644 --- a/src/runtime/malloc.go +++ b/src/runtime/malloc.go @@ -312,6 +312,7 @@ func profilealloc(mp *m, x unsafe.Pointer, size uintptr) { // For now this must be bracketed with a stoptheworld and a starttheworld to ensure // all go routines see the new barrier. +//go:nowritebarrier func gcinstallmarkwb() { gcphase = _GCmark } @@ -389,6 +390,7 @@ func gcwork(force int32) { gctimer.cycle.installmarkwb = nanotime() systemstack(stoptheworld) systemstack(gcinstallmarkwb) + systemstack(harvestwbufs) systemstack(starttheworld) gctimer.cycle.mark = nanotime() systemstack(gcmark_m) -- cgit v1.3-5-g9baa