Commit 000c1c51 authored by Andrew Gerrand's avatar Andrew Gerrand

[release-branch.go1.2] runtime: remove nomemprof

««« CL 14695044 / 35d5bae6aac8
runtime: remove nomemprof
Nomemprof seems to be unneeded now, there is no recursion.
If the recursion will be re-introduced, it will break loudly by deadlocking.
Fixes #6566.

R=golang-dev, minux.ma, rsc
CC=golang-dev
https://golang.org/cl/14695044
»»»

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/20540043
parent c1792398
...@@ -255,10 +255,6 @@ runtime·MProf_Malloc(void *p, uintptr size) ...@@ -255,10 +255,6 @@ runtime·MProf_Malloc(void *p, uintptr size)
uintptr stk[32]; uintptr stk[32];
Bucket *b; Bucket *b;
if(m->nomemprof > 0)
return;
m->nomemprof++;
nstk = runtime·callers(1, stk, 32); nstk = runtime·callers(1, stk, 32);
runtime·lock(&proflock); runtime·lock(&proflock);
b = stkbucket(MProf, stk, nstk, true); b = stkbucket(MProf, stk, nstk, true);
...@@ -266,7 +262,6 @@ runtime·MProf_Malloc(void *p, uintptr size) ...@@ -266,7 +262,6 @@ runtime·MProf_Malloc(void *p, uintptr size)
b->recent_alloc_bytes += size; b->recent_alloc_bytes += size;
setaddrbucket((uintptr)p, b); setaddrbucket((uintptr)p, b);
runtime·unlock(&proflock); runtime·unlock(&proflock);
m->nomemprof--;
} }
// Called when freeing a profiled block. // Called when freeing a profiled block.
...@@ -275,10 +270,6 @@ runtime·MProf_Free(void *p, uintptr size) ...@@ -275,10 +270,6 @@ runtime·MProf_Free(void *p, uintptr size)
{ {
Bucket *b; Bucket *b;
if(m->nomemprof > 0)
return;
m->nomemprof++;
runtime·lock(&proflock); runtime·lock(&proflock);
b = getaddrbucket((uintptr)p); b = getaddrbucket((uintptr)p);
if(b != nil) { if(b != nil) {
...@@ -286,7 +277,6 @@ runtime·MProf_Free(void *p, uintptr size) ...@@ -286,7 +277,6 @@ runtime·MProf_Free(void *p, uintptr size)
b->recent_free_bytes += size; b->recent_free_bytes += size;
} }
runtime·unlock(&proflock); runtime·unlock(&proflock);
m->nomemprof--;
} }
int64 runtime·blockprofilerate; // in CPU ticks int64 runtime·blockprofilerate; // in CPU ticks
......
...@@ -133,7 +133,6 @@ runtime·schedinit(void) ...@@ -133,7 +133,6 @@ runtime·schedinit(void)
runtime·sched.maxmcount = 10000; runtime·sched.maxmcount = 10000;
runtime·precisestack = haveexperiment("precisestack"); runtime·precisestack = haveexperiment("precisestack");
m->nomemprof++;
runtime·mprofinit(); runtime·mprofinit();
runtime·mallocinit(); runtime·mallocinit();
mcommoninit(m); mcommoninit(m);
...@@ -163,7 +162,6 @@ runtime·schedinit(void) ...@@ -163,7 +162,6 @@ runtime·schedinit(void)
procresize(procs); procresize(procs);
mstats.enablegc = 1; mstats.enablegc = 1;
m->nomemprof--;
if(raceenabled) if(raceenabled)
g->racectx = runtime·raceinit(); g->racectx = runtime·raceinit();
......
...@@ -310,7 +310,6 @@ struct M ...@@ -310,7 +310,6 @@ struct M
int32 throwing; int32 throwing;
int32 gcing; int32 gcing;
int32 locks; int32 locks;
int32 nomemprof;
int32 dying; int32 dying;
int32 profilehz; int32 profilehz;
int32 helpgc; int32 helpgc;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment