From 9b88857f7565a426d1469e8a9b51d9bf045adc9b Mon Sep 17 00:00:00 2001 From: Shenghou Ma Date: Tue, 12 Aug 2014 22:28:25 -0400 Subject: [PATCH] [dev.power64] runtime: disable GC and use a larger default stack LGTM=rsc R=rsc, iant CC=golang-codereviews https://golang.org/cl/128120043 --- src/pkg/runtime/malloc.go | 2 +- src/pkg/runtime/mgc0.c | 4 ++++ src/pkg/runtime/stack.h | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/pkg/runtime/malloc.go b/src/pkg/runtime/malloc.go index dedcea94a6..68baa80d52 100644 --- a/src/pkg/runtime/malloc.go +++ b/src/pkg/runtime/malloc.go @@ -278,7 +278,7 @@ func profilealloc(mp *m, x unsafe.Pointer, size uintptr) { // force = 1 - do GC regardless of current heap usage // force = 2 - go GC and eager sweep func gogc(force int32) { - if memstats.enablegc == 0 { + if GOARCH == "power64" || GOARCH == "power64le" || memstats.enablegc == 0 { return } diff --git a/src/pkg/runtime/mgc0.c b/src/pkg/runtime/mgc0.c index e7955151ce..03622db283 100644 --- a/src/pkg/runtime/mgc0.c +++ b/src/pkg/runtime/mgc0.c @@ -1305,6 +1305,10 @@ runtime·gc(int32 force) if(!mstats.enablegc || g == g->m->g0 || g->m->locks > 0 || runtime·panicking) return; + if(thechar == '9') { + runtime·gcpercent = -1; + return; + } if(runtime·gcpercent == GcpercentUnknown) { // first time through runtime·lock(&runtime·mheap); if(runtime·gcpercent == GcpercentUnknown) diff --git a/src/pkg/runtime/stack.h b/src/pkg/runtime/stack.h index ee5fd351d5..64d377754f 100644 --- a/src/pkg/runtime/stack.h +++ b/src/pkg/runtime/stack.h @@ -76,7 +76,7 @@ enum { // The minimum stack segment size to allocate. // If the amount needed for the splitting frame + StackExtra // is less than this number, the stack will have this size instead. - StackMin = 8192, + StackMin = 65536, StackSystemRounded = StackSystem + (-StackSystem & (StackMin-1)), FixedStack = StackMin + StackSystemRounded, -- 2.51.0