Skip to content

Commit 20ed279

Browse files
prattmicpull[bot]
authored andcommitted
runtime: remove write-only sweepdata fields
Change-Id: Ia238889a704812473b838b20efedfe9d24b1e26f Reviewed-on: https://go-review.googlesource.com/c/go/+/534160 Auto-Submit: Michael Pratt <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Michael Knyszek <[email protected]>
1 parent 63abd5e commit 20ed279

File tree

2 files changed

+0
-12
lines changed

2 files changed

+0
-12
lines changed

src/runtime/mgc.go

-7
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,6 @@ func GC() {
476476
// as part of tests and benchmarks to get the system into a
477477
// relatively stable and isolated state.
478478
for work.cycles.Load() == n+1 && sweepone() != ^uintptr(0) {
479-
sweep.nbgsweep++
480479
Gosched()
481480
}
482481

@@ -620,7 +619,6 @@ func gcStart(trigger gcTrigger) {
620619
// We check the transition condition continuously here in case
621620
// this G gets delayed in to the next GC cycle.
622621
for trigger.test() && sweepone() != ^uintptr(0) {
623-
sweep.nbgsweep++
624622
}
625623

626624
// Perform GC initialization and the sweep termination
@@ -1047,10 +1045,6 @@ func gcMarkTermination() {
10471045
// Reset idle time stat.
10481046
sched.idleTime.Store(0)
10491047

1050-
// Reset sweep state.
1051-
sweep.nbgsweep = 0
1052-
sweep.npausesweep = 0
1053-
10541048
if work.userForced {
10551049
memstats.numforcedgc++
10561050
}
@@ -1589,7 +1583,6 @@ func gcSweep(mode gcMode) bool {
15891583
}
15901584
// Sweep all spans eagerly.
15911585
for sweepone() != ^uintptr(0) {
1592-
sweep.npausesweep++
15931586
}
15941587
// Free workbufs eagerly.
15951588
prepareFreeWorkbufs()

src/runtime/mgcsweep.go

-5
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@ type sweepdata struct {
3737
g *g
3838
parked bool
3939

40-
nbgsweep uint32
41-
npausesweep uint32
42-
4340
// active tracks outstanding sweepers and the sweep
4441
// termination condition.
4542
active activeSweep
@@ -237,7 +234,6 @@ func finishsweep_m() {
237234
// instantly. If GC was forced before the concurrent sweep
238235
// finished, there may be spans to sweep.
239236
for sweepone() != ^uintptr(0) {
240-
sweep.npausesweep++
241237
}
242238

243239
// Make sure there aren't any outstanding sweepers left.
@@ -299,7 +295,6 @@ func bgsweep(c chan int) {
299295
const sweepBatchSize = 10
300296
nSwept := 0
301297
for sweepone() != ^uintptr(0) {
302-
sweep.nbgsweep++
303298
nSwept++
304299
if nSwept%sweepBatchSize == 0 {
305300
goschedIfBusy()

0 commit comments

Comments
 (0)