mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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>
This commit is contained in:
parent
9c81fd53b3
commit
bfbb288574
3 changed files with 9 additions and 53 deletions
|
|
@ -727,12 +727,6 @@ type p struct {
|
|||
// Modified using atomic instructions.
|
||||
numTimers uint32
|
||||
|
||||
// Number of timerModifiedEarlier timers on P's heap.
|
||||
// This should only be modified while holding timersLock,
|
||||
// or while the timer status is in a transient state
|
||||
// such as timerModifying.
|
||||
adjustTimers uint32
|
||||
|
||||
// Number of timerDeleted timers in P's heap.
|
||||
// Modified using atomic instructions.
|
||||
deletedTimers uint32
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue