mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
runtime: don't let P's timer heap get clogged with deleted timers
Whenever more than 1/4 of the timers on a P's heap are deleted, remove them from the heap. Change-Id: Iff63ed3d04e6f33ffc5c834f77f645c52c007e52 Reviewed-on: https://go-review.googlesource.com/c/go/+/214299 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com>
This commit is contained in:
parent
1d4d7825a7
commit
641e61db57
3 changed files with 134 additions and 2 deletions
|
|
@ -650,6 +650,10 @@ type p struct {
|
|||
// such as timerModifying.
|
||||
adjustTimers uint32
|
||||
|
||||
// Number of timerDeleted times in P's heap.
|
||||
// Modified using atomic instructions.
|
||||
deletedTimers uint32
|
||||
|
||||
// Race context used while executing timer functions.
|
||||
timerRaceCtx uintptr
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue