]> Cypherpunks repositories - gostls13.git/commitdiff
[release-branch.go1.2] runtime: remove nomemprof
authorAndrew Gerrand <adg@golang.org>
Thu, 31 Oct 2013 23:51:42 +0000 (10:51 +1100)
committerAndrew Gerrand <adg@golang.org>
Thu, 31 Oct 2013 23:51:42 +0000 (10:51 +1100)
««« 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

src/pkg/runtime/mprof.goc
src/pkg/runtime/proc.c
src/pkg/runtime/runtime.h

index a8d57e7635b60df426d40c0423ebc56ad7feafb6..5b92cec95c72856053f84bf785cf8875db084dae 100644 (file)
@@ -255,10 +255,6 @@ runtime·MProf_Malloc(void *p, uintptr size)
        uintptr stk[32];
        Bucket *b;
 
-       if(m->nomemprof > 0)
-               return;
-
-       m->nomemprof++;
        nstk = runtime·callers(1, stk, 32);
        runtime·lock(&proflock);
        b = stkbucket(MProf, stk, nstk, true);
@@ -266,7 +262,6 @@ runtime·MProf_Malloc(void *p, uintptr size)
        b->recent_alloc_bytes += size;
        setaddrbucket((uintptr)p, b);
        runtime·unlock(&proflock);
-       m->nomemprof--;
 }
 
 // Called when freeing a profiled block.
@@ -275,10 +270,6 @@ runtime·MProf_Free(void *p, uintptr size)
 {
        Bucket *b;
 
-       if(m->nomemprof > 0)
-               return;
-
-       m->nomemprof++;
        runtime·lock(&proflock);
        b = getaddrbucket((uintptr)p);
        if(b != nil) {
@@ -286,7 +277,6 @@ runtime·MProf_Free(void *p, uintptr size)
                b->recent_free_bytes += size;
        }
        runtime·unlock(&proflock);
-       m->nomemprof--;
 }
 
 int64 runtime·blockprofilerate;  // in CPU ticks
index eb3263fc91906da6fab61b4c65fd4f3e52b897b8..de26c72d3d7553243dd79c7e6ffcef95fb5ef8a4 100644 (file)
@@ -133,7 +133,6 @@ runtime·schedinit(void)
        runtime·sched.maxmcount = 10000;
        runtime·precisestack = haveexperiment("precisestack");
 
-       m->nomemprof++;
        runtime·mprofinit();
        runtime·mallocinit();
        mcommoninit(m);
@@ -163,7 +162,6 @@ runtime·schedinit(void)
        procresize(procs);
 
        mstats.enablegc = 1;
-       m->nomemprof--;
 
        if(raceenabled)
                g->racectx = runtime·raceinit();
index c989edcf8d09809ecd0e84639cc4267682e721f9..f7c2adb12192fc5c6199b9d24e919274910a3c91 100644 (file)
@@ -310,7 +310,6 @@ struct      M
        int32   throwing;
        int32   gcing;
        int32   locks;
-       int32   nomemprof;
        int32   dying;
        int32   profilehz;
        int32   helpgc;