aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/proc.go
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2021-07-25 16:26:13 -0700
committerIan Lance Taylor <iant@golang.org>2021-07-26 22:15:24 +0000
commitbfbb288574841f2db2499a580d7bf985a5df4556 (patch)
tree944225304fd4914a4e62729ce554e62e3e913616 /src/runtime/proc.go
parent9c81fd53b3ae52e286d3020ee8b381328b6b9bd2 (diff)
downloadgo-bfbb288574841f2db2499a580d7bf985a5df4556.tar.gz
go-bfbb288574841f2db2499a580d7bf985a5df4556.zip
runtime: remove adjustTimers counter
In CL 336432 we changed adjusttimers so that it no longer cleared timerModifiedEarliest if there were no timersModifiedEarlier timers. This caused some Google internal tests to time out, presumably due to the increased contention on timersLock. We can avoid that by simply not skipping the loop in adjusttimers, which lets us safely clear timerModifiedEarliest. And if we don't skip the loop, then there isn't much reason to keep the count of timerModifiedEarlier timers at all. So remove it. The effect will be that for programs that create some timerModifiedEarlier timers and then remove them all, the program will do an occasional additional loop over all the timers. And, programs that have some timerModifiedEarlier timers will always loop over all the timers, without the quicker exit when they have all been seen. But the loops should not occur all that often, due to timerModifiedEarliest. For #47329 Change-Id: I7b244c1244d97b169a3c7fbc8f8a8b115731ddee Reviewed-on: https://go-review.googlesource.com/c/go/+/337309 Trust: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Michael Pratt <mpratt@google.com>
Diffstat (limited to 'src/runtime/proc.go')
-rw-r--r--src/runtime/proc.go1
1 files changed, 0 insertions, 1 deletions
diff --git a/src/runtime/proc.go b/src/runtime/proc.go
index 4c92588a66..7bc2a92590 100644
--- a/src/runtime/proc.go
+++ b/src/runtime/proc.go
@@ -4919,7 +4919,6 @@ func (pp *p) destroy() {
moveTimers(plocal, pp.timers)
pp.timers = nil
pp.numTimers = 0
- pp.adjustTimers = 0
pp.deletedTimers = 0
atomic.Store64(&pp.timer0When, 0)
unlock(&pp.timersLock)