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
}
// Flush MCache's to MCentral.
- runtime·mcall(flushallmcaches_m);
+ if(g == g->m->g0)
+ flushallmcaches();
+ else
+ runtime·mcall(flushallmcaches_m);
// Aggregate local stats.
cachestats();