]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: fix gctrace=1
authorKeith Randall <khr@golang.org>
Fri, 18 Jul 2014 09:05:21 +0000 (13:05 +0400)
committerDmitriy Vyukov <dvyukov@google.com>
Fri, 18 Jul 2014 09:05:21 +0000 (13:05 +0400)
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

src/pkg/runtime/mgc0.c

index 8b9779da6b78e0b2a1a92706e3b990328cc14219..2d478acdc4d02df1a2fc54e6edc71a0317a3874c 100644 (file)
@@ -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();