]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: remove useless nFlushCacheRoots
authorLeonard Wang <wangdeyu0907@gmail.com>
Fri, 16 Apr 2021 15:30:59 +0000 (23:30 +0800)
committerEmmanuel Odeke <emmanuel@orijtech.com>
Fri, 16 Apr 2021 21:50:38 +0000 (21:50 +0000)
Change-Id: I70cb8f8e9a0eec68ea11f22ca8699aa7e0c91ede
Reviewed-on: https://go-review.googlesource.com/c/go/+/310710
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Trust: Emmanuel Odeke <emmanuel@orijtech.com>

src/runtime/mgc.go
src/runtime/mgcmark.go

index e4bbf1f016a7b6993d52e358cdd24389b257f129..601593087da3b1f15490439f44ce2f83a0dbabb0 100644 (file)
@@ -325,11 +325,9 @@ var work struct {
        nwait  uint32
 
        // Number of roots of various root types. Set by gcMarkRootPrepare.
-       nFlushCacheRoots                               int
        nDataRoots, nBSSRoots, nSpanRoots, nStackRoots int
 
        // Base indexes of each root type. Set by gcMarkRootPrepare.
-       baseFlushCache                                    uint32
        baseData, baseBSS, baseSpans, baseStacks, baseEnd uint32
 
        // Each type of GC state transition is protected by a lock.
index 061d2f5c9d1d687ecbd44750d331e14c36aa68c1..719b21055b23ae510b96c88d600226912e7ec233 100644 (file)
@@ -56,8 +56,6 @@ const (
 func gcMarkRootPrepare() {
        assertWorldStopped()
 
-       work.nFlushCacheRoots = 0
-
        // Compute how many data and BSS root blocks there are.
        nBlocks := func(bytes uintptr) int {
                return int(divRoundUp(bytes, rootBlockBytes))
@@ -105,11 +103,10 @@ func gcMarkRootPrepare() {
        work.nStackRoots = int(atomic.Loaduintptr(&allglen))
 
        work.markrootNext = 0
-       work.markrootJobs = uint32(fixedRootCount + work.nFlushCacheRoots + work.nDataRoots + work.nBSSRoots + work.nSpanRoots + work.nStackRoots)
+       work.markrootJobs = uint32(fixedRootCount + work.nDataRoots + work.nBSSRoots + work.nSpanRoots + work.nStackRoots)
 
        // Calculate base indexes of each root type
-       work.baseFlushCache = uint32(fixedRootCount)
-       work.baseData = work.baseFlushCache + uint32(work.nFlushCacheRoots)
+       work.baseData = uint32(fixedRootCount)
        work.baseBSS = work.baseData + uint32(work.nDataRoots)
        work.baseSpans = work.baseBSS + uint32(work.nBSSRoots)
        work.baseStacks = work.baseSpans + uint32(work.nSpanRoots)
@@ -159,9 +156,6 @@ var oneptrmask = [...]uint8{1}
 func markroot(gcw *gcWork, i uint32) {
        // Note: if you add a case here, please also update heapdump.go:dumproots.
        switch {
-       case work.baseFlushCache <= i && i < work.baseData:
-               flushmcache(int(i - work.baseFlushCache))
-
        case work.baseData <= i && i < work.baseBSS:
                for _, datap := range activeModules() {
                        markrootBlock(datap.data, datap.edata-datap.data, datap.gcdatamask.bytedata, gcw, int(i-work.baseData))