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
This commit is contained in:
Keith Randall 2014-07-18 13:05:21 +04:00 committed by Dmitriy Vyukov
parent 5d58033682
commit 2425a2e32f

View 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();