From: Keith Randall Date: Fri, 18 Jul 2014 09:05:21 +0000 (+0400) Subject: runtime: fix gctrace=1 X-Git-Tag: go1.4beta1~1064 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=2425a2e32f57a5df3a048a06431089fd83e8cec9;p=gostls13.git runtime: fix gctrace=1 updatememstats is called on both the m and g stacks. Call into flushallmcaches correctly. flushallmcaches can only run on the M stack. This is somewhat temporary. once ReadMemStats is in Go we can have all of this code M-only. LGTM=dvyukov R=golang-codereviews, dvyukov CC=golang-codereviews https://golang.org/cl/116880043 --- diff --git a/src/pkg/runtime/mgc0.c b/src/pkg/runtime/mgc0.c index 8b9779da6b..2d478acdc4 100644 --- a/src/pkg/runtime/mgc0.c +++ b/src/pkg/runtime/mgc0.c @@ -2172,7 +2172,10 @@ runtime·updatememstats(GCStats *stats) } // Flush MCache's to MCentral. - runtime·mcall(flushallmcaches_m); + if(g == g->m->g0) + flushallmcaches(); + else + runtime·mcall(flushallmcaches_m); // Aggregate local stats. cachestats();