]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: remove write-only sweepdata fields
authorMichael Pratt <mpratt@google.com>
Tue, 10 Oct 2023 19:30:09 +0000 (15:30 -0400)
committerGopher Robot <gobot@golang.org>
Wed, 11 Oct 2023 16:55:22 +0000 (16:55 +0000)
Change-Id: Ia238889a704812473b838b20efedfe9d24b1e26f
Reviewed-on: https://go-review.googlesource.com/c/go/+/534160
Auto-Submit: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
src/runtime/mgc.go
src/runtime/mgcsweep.go

index da8e578eb653b4fb271132619d2a47fd338fe02d..f7f7eb45287f261fc8af81d9f0a60a638d47ca94 100644 (file)
@@ -476,7 +476,6 @@ func GC() {
        // as part of tests and benchmarks to get the system into a
        // relatively stable and isolated state.
        for work.cycles.Load() == n+1 && sweepone() != ^uintptr(0) {
-               sweep.nbgsweep++
                Gosched()
        }
 
@@ -620,7 +619,6 @@ func gcStart(trigger gcTrigger) {
        // We check the transition condition continuously here in case
        // this G gets delayed in to the next GC cycle.
        for trigger.test() && sweepone() != ^uintptr(0) {
-               sweep.nbgsweep++
        }
 
        // Perform GC initialization and the sweep termination
@@ -1047,10 +1045,6 @@ func gcMarkTermination() {
        // Reset idle time stat.
        sched.idleTime.Store(0)
 
-       // Reset sweep state.
-       sweep.nbgsweep = 0
-       sweep.npausesweep = 0
-
        if work.userForced {
                memstats.numforcedgc++
        }
@@ -1589,7 +1583,6 @@ func gcSweep(mode gcMode) bool {
                }
                // Sweep all spans eagerly.
                for sweepone() != ^uintptr(0) {
-                       sweep.npausesweep++
                }
                // Free workbufs eagerly.
                prepareFreeWorkbufs()
index 986eb573ca42ab7205f45e222c0e6e8453f13c32..aeb04c923ea60a09fa8312ca42beffc64e975e0e 100644 (file)
@@ -37,9 +37,6 @@ type sweepdata struct {
        g      *g
        parked bool
 
-       nbgsweep    uint32
-       npausesweep uint32
-
        // active tracks outstanding sweepers and the sweep
        // termination condition.
        active activeSweep
@@ -237,7 +234,6 @@ func finishsweep_m() {
        // instantly. If GC was forced before the concurrent sweep
        // finished, there may be spans to sweep.
        for sweepone() != ^uintptr(0) {
-               sweep.npausesweep++
        }
 
        // Make sure there aren't any outstanding sweepers left.
@@ -299,7 +295,6 @@ func bgsweep(c chan int) {
                const sweepBatchSize = 10
                nSwept := 0
                for sweepone() != ^uintptr(0) {
-                       sweep.nbgsweep++
                        nSwept++
                        if nSwept%sweepBatchSize == 0 {
                                goschedIfBusy()