diff options
author | Austin Clements <austin@google.com> | 2016-10-05 21:22:33 -0400 |
---|---|---|
committer | Austin Clements <austin@google.com> | 2016-10-25 22:33:02 +0000 |
commit | 575b1dda4ec845aea6b5c475e9d748dc76d1bc06 (patch) | |
tree | 423152afc5ab82338ece64659c3deb20c0e20add /src/runtime/mgcsweep.go | |
parent | c95a8e458fdf9f3cb0c176ac92a513e5dc9b32c1 (diff) | |
download | go-575b1dda4ec845aea6b5c475e9d748dc76d1bc06.tar.gz go-575b1dda4ec845aea6b5c475e9d748dc76d1bc06.zip |
runtime: eliminate allspans snapshot
Now that sweeping and span marking use the sweep list, there's no need
for the work.spans snapshot of the allspans list. This change
eliminates the few remaining uses of it, which are either dead code or
can use allspans directly, and removes work.spans and its support
functions.
Change-Id: Id5388b42b1e68e8baee853d8eafb8bb4ff95bb43
Reviewed-on: https://go-review.googlesource.com/30537
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rick Hudson <rlh@golang.org>
Diffstat (limited to 'src/runtime/mgcsweep.go')
-rw-r--r-- | src/runtime/mgcsweep.go | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/src/runtime/mgcsweep.go b/src/runtime/mgcsweep.go index 8119ade5a5..e74a451d0d 100644 --- a/src/runtime/mgcsweep.go +++ b/src/runtime/mgcsweep.go @@ -28,8 +28,13 @@ type sweepdata struct { pacertracegen uint32 } +// finishsweep_m ensures that all spans are swept. +// +// The world must be stopped. This ensures there are no sweeps in +// progress. +// //go:nowritebarrier -func finishsweep_m(stw bool) { +func finishsweep_m() { // Sweeping must be complete before marking commences, so // sweep any unswept spans. If this is a concurrent GC, there // shouldn't be any spans left to sweep, so this should finish @@ -39,20 +44,6 @@ func finishsweep_m(stw bool) { sweep.npausesweep++ } - // There may be some other spans being swept concurrently that - // we need to wait for. If finishsweep_m is done with the world stopped - // this is not required because the STW must have waited for sweeps. - // - // TODO(austin): As of this writing, we always pass true for stw. - // Consider removing this code. - if !stw { - sg := mheap_.sweepgen - for _, s := range work.spans { - if s.sweepgen != sg && s.state == _MSpanInUse { - s.ensureSwept() - } - } - } nextMarkBitArenaEpoch() } |